Added option to enable/disable logging of invalid nesting.
Merge branch 'optional-logging'