Skip to main content

LoggingCommandModule

A static class in Root.Township, Alta.Console.Commands.

Console module logs: commands that change NLog rules at runtime, print the logging config and open the log folder.

Fields​

1 private and internal field
MemberWhat it is
private static readonly Logger loggerNLog logger for this module.

Methods​

MemberWhat it is
static void PrintWarningsWithStacktrace(bool isEnabled = true)logs warn-stack: sets the CentralLoggingErrors target to log from warn level (on) or error level (off).
4 private and internal methods
MemberWhat it is
private static void ChangeConfig(string targetName, string minLevel, string maxLevel = "fatal", string loggerNamePattern = "*")logs change-target: replaces the logging rule for the named target with new min and max levels and a logger name pattern.
private static void OpenLogFile()logs open: opens the log folder in the OS file browser.
private static string PrintConfig(bool isPrintingAll = false)logs config: returns the current logging rules, or the whole NLog config file text when asked for all.
private static void SetDestroyTrace(bool isEnabled = true)logs destroy-trace: turns on or off error logs with a stack trace whenever an object is destroyed (ObjectUtility.TraceObjectDestroyWithErrorLogs).