Show / Hide Table of Contents

Enum ExceptionLogger.OutputOptions

Use these flags to control the output. There is no flag for the Message property, which always becomes part of the message.

Namespace: WizardWrx.DLLConfigurationManager
Assembly: WizardWrx.DLLConfigurationManager.dll
Syntax
public enum OutputOptions : byte
Remarks

DiscardNewlines and NBSpaceForNewlines arose to resolve an issue that came to light when a desire arose to reconstruct an exception report from the message posted into a Microsoft Excel workbook that was populated from the output of a run of PsLogList.exe. To cause it to keep each message on a single logical line, so that it would import into a single worksheet row, PsLogList.exe is invoked with its -s switch, causing PsLogList to print (output) Event Log records one-per-line, with comma delimited fields.

To preserve the newlines in the event log file and have some indication of their original positions when PsLogList strips them, set the NBSpaceForNewlines flag to TRUE. This causes each embedded newline to be preceded in the output by a NOLBREAKING_SPACE (ASCII character code 160, A0h, Unicode code point U+0A0) character.

To substitute a NOLBREAKING_SPACE for each newline, set this flag AND DiscardNewlines to TRUE.

Fields

Name Description
ActiveProperties

Use this bit mask to include all auxiliary properties of the Exception (StackTrace, TargetSite, Source, DiscardNewlines, and NBSpaceForNewlines) in the report, or to strip them form a set of flags.

ActivePropsEverywhere

Use this bit mask to include all auxiliary properties of the Exception (StackTrace, TargetSite, and Source) in the report, and to send the report to a Windows event log and both the standard output and standard error streams. This is useful when you know that the standard output is redirected, and you want to preserve the report in the output file, in addition to having a copy displayed on the console.

ActivePropsToEventLog

Use this bit mask to include all auxiliary properties of the Exception (StackTrace, TargetSite, and Source) in the report, and to send the report to a Windows event log.

ActivePropsToStdErr

Use this bit mask to include all auxiliary properties of the Exception (StackTrace, TargetSite, and Source) in the report, and to send the report to the standard error stream.

ActivePropsToStdOut

Use this bit mask to include all auxiliary properties of the Exception (StackTrace, TargetSite, and Source) in the report, and to send the report to the standard output stream.

AllDestiations

Use this flag to include all destinations for output, or as a mask to strip them from a set of flags.

AllFlags

This flag turns on everything, and is of no practical use, but is defined for reference, to document that every bit in the byte is accounted for. Now that all bits have assignments, this flag and AllProperties resolve to the same value.

AllProperties

Use this flag to include all auxiliary properties of the Exception (StackTrace, TargetSite, Source, DiscardNewlines, and NBSpaceForNewlines) in the report, or to strip them form a set of flags.

DiscardNewlines

Discard newlines entirely, unless NBSpaceForNewlines is also true, in which case each newline is retained, preceded by a NOLBREAKING_SPACE (ASCII character code 160, A0h, U+0A0) character.

Please see the Remarks on the enumeration for important details.

EventLog

Post to associated event log if TRUE.

The value of the event source associated with the current ExceptionLogger instance determines which event log gets the message.

WARNING: Unless your event source string is already registered, the application MUST run, one time only, with full administrator privileges AND use the event source to write a message into the Windows event log in order for it to be registered with Windows, which maps it to an event log. Alternatively, you may register the event source by any number of other means, such as by way of an installation script.

Once the event source string is registered, the application can use it to post messages to the event log in any Windows security context.

Method

Show Method Name if TRUE.

If the EventLog flag is also set, the method name is always written there.

NBSpaceForNewlines

Precede each newline with a NOLBREAKING_SPACE (ASCII character code 160, A0h, Unicode code point U+0A0) character, unless DiscardNewlines is also true, in which case a NOLBREAKING_SPACE precedes the newline, which is preserved.

Please see the Remarks on the enumeration for important details.

NoFlags

Use this member to evaluate whether all flags are OFF.

ReplaceNewlines

Deploy this flag combination to substitute a NOLBREAKING_SPACE (ASCII character code 160, A0h, Unicode code point U+0A0) for every platform-dependent newline. On a Windows platform, the outcome is a slightly shorter message string, since each space replaces two characters. In all cases, the NOLBREAKING_SPACE guarantees that each event record occupies one line when output as text, while providing a means of restoring the newlines by reversing the replacement.

Source

Show Source (Assembly) Name if TRUE.

If the EventLog flag is also set, the originating assembly name is always written there.

Stack

Show Stack Trace if TRUE.

If the EventLog flag is also set, the stack trace is always written there.

StandardError

Write message on STDERR if TRUE and if the application has a working console.

The setting of this flag also governs the behavior of the ScrollUp method.

CAUTION: Although it is technically legal to set both StandardOutput and StandardError to TRUE, this can have the unwanted consequence of generating TWO copies of the message, unless STDOUT and/or STDERR is directed to a file or if both are redirected to the SAME file.

StandardOutput

Write message on STDOUT if TRUE and if the application has a working console.

The setting of this flag also governs the behavior of the ScrollUp method.

CAUTION: Although it is technically legal to set both StandardOutput and StandardError to TRUE, this can have the unwanted consequence of generating TWO copies of the message, unless STDOUT and/or STDERR is directed to a file or if both are redirected to the SAME file.

See Also
ExceptionLogger.ErrorExitOptions
  • Improve this Doc
  • View Source
Back to top Generated by DocFX