Class LogUtils
Contains static methods for log handling.
public static class LogUtils
- Inheritance
-
LogUtils
Fields
- Flags
Log related flags.
- RedirectLogFromFileToScreen
Gets or sets whether to redirect all log to file operations to Log(object?, LogItemKind).
- ShowDebugWelcomeMessage
Gets or sets whether to show debug welcome message with version number and other information.
Properties
- LogPropMaxLength
Gets or sets max property value length for the LogPropLimitLength(object?, string, string?)
- SectionSeparator
Gets or sets string which is logged before and after log section.
Methods
- DebugLogToFile(object?, string?)
Same as LogToFile(object?, string?) but writes message to file only under debug environment (DEBUG conditional is defined).
- DebugLogToFileIf(object?, bool, string?)
Same as LogToFile(object?, string?) but writes message to file only under debug environment (DEBUG conditional is defined) and if
conditional
istrue
.
- DebugLogVersion(bool)
Logs environment versions.
- DeleteLog()
Deletes application log file (specified in LogFilePath).
- EnumLogActions(Action<string, Action>)
Enumerates registered log actions.
- GenNewId()
Gets unique id for debug purposes.
- GetEventKey(Type?, EventInfo?)
Gets event key.
- GetLogMethod(bool, LogItemKind)
Gets logging method based on the
toFile
parameter value.
- GetLogVersionText()
Gets text for LogVersion(bool).
- IsEventLogged(string)
Returns whether specified event is logged.
- IsEventLogged(Type?, EventInfo?)
Returns whether specified event is logged.
- LogActionToAction(Action, Action<string>)
Temporary adds
logAction
to LogMessage event and callsaction
.
- LogActionToFile(Action, string?, string?)
Logs section using LogBeginSectionToFile(string?, string?), LogEndSectionToFile(string?) and calling
action
between these calls.
- LogAndToFile(object?)
Logs message using Log(object?, LogItemKind) and after that calls LogToFile(object?, string?).
- LogAppFinishedToFile()
Writes to log file "Application finished" header text.
- LogAppStartedToFile()
Writes to log file "Application started" header text.
- LogAsSection(IEnumerable?, LogItemKind)
Logs IEnumerable as section.
- LogBeginSectionToFile(string?, string?)
Begins log to file section.
- LogColor(string?, Color?)
Logs Color value.
- LogDrawAction(double, Func<Graphics, SizeD>, Action<Graphics>?)
Logs draw action to log.
- LogEndSectionToFile(string?)
Ends log to file section.
- LogException(Exception, LogItemKind, bool)
Logs Exception information.
- LogExceptionIfDebug(Exception)
Logs Exception information if DEBUG is defined.
- LogExceptionToConsole(Exception)
Logs exception to console.
- LogExceptionToFile(Exception, string?)
Logs Exception information to file.
- LogFontsInformation()
Logs all fonts related information.
- LogImage(Image)
Adds Image to log.
- LogInvalidBoundArgument(string, object, object, object)
Logs error 'InvalidBoundArgument'.
- LogInvalidBoundArgumentUInt(string, int)
Logs error 'InvalidBoundArgument' for unsigned int values.
- LogNameValueToFile(object, object?, string?)
Logs to file pair of name and value as "{name} = {value}".
- LogProp(object?, string, string?, LogItemKind)
Writes to log property value of the specified object.
- LogPropLimitLength(object?, string, string?)
Writes to log property value of the specified object.
- LogRangeToFile(IEnumerable, string?, string?)
Logs IEnumerable to file.
- LogSectionToFile(object?, string?, string?)
Logs section using LogBeginSectionToFile(string?, string?), LogEndSectionToFile(string?) and logging
obj
between these calls.
- LogTextAndFontStyle(TextAndFontStyle[])
Logs image created from an array with TextAndFontStyle elements.
- LogToExternalIfAllowed(string?, LogItemKind)
Logs message to file, debug output and console if it is allowed.
- LogToFile(object?, string?)
Logs message to the specified file or to default application log file.
- LogVersion(bool)
Logs environment versions.
- RegisterLogAction(string, Action)
Registers log action which will be shown in the Developer Tools window.
- SetEventLogged(Type?, EventInfo?, bool)
Sets whether to log specified event.
- ShowTestActionsDialog()
Shows a dialog with the list of test actions.