SystemExt.Demo/Log.cs
/// <summary>
/// A demo which iterates over log levels and writes messages at each.
/// </summary>
/// <param name="arg">
/// Command line arguments.
/// </param>
/// <returns>
/// The code to terminate the application with on exit.
/// </returns>
A demo which iterates over log levels and writes messages at each.
A demo which iterates over log levels and writes messages at each .
private static int LogLevels(string[] arg)
        {
            var manager = new LogManager();
            var logger = new StreamLogger(Console.OpenStandardOutput());
            for (var level = LogLevel.None; level <= LogLevel.Verbose; level++)
            {
                Console.WriteLine("Setting log level to {0:G}.", level);
                manager.AddLogger("DEMO", level, logger);
                manager.Write(LogLevel.Verbose, "DEMO", "Verbose!");
                manager.Write(LogLevel.Information, "DEMO", "Information!");
                manager.Write(LogLevel.Warning, "DEMO", "Warning!");
                manager.Write(LogLevel.Error, "DEMO", "Error!");
                manager.Write(LogLevel.Critical, "DEMO", "Critical!");
            }
            Console.WriteLine("Press any key to exit.");
            Console.ReadKey();
            return 0;
        }
private static int LogLevels ( string [ ] arg ) { var manager = new LogManager ( ) ; var logger = new StreamLogger ( Console . OpenStandardOutput ( ) ) ; for ( var level = LogLevel . None ; level <= LogLevel . Verbose ; level ++ ) { Console . WriteLine ( " " , level ) ; manager . AddLogger ( " " , level , logger ) ; manager . Write ( LogLevel . Verbose , " " , " " ) ; manager . Write ( LogLevel . Information , " " , " " ) ; manager . Write ( LogLevel . Warning , " " , " " ) ; manager . Write ( LogLevel . Error , " " , " " ) ; manager . Write ( LogLevel . Critical , " " , " " ) ; } Console . WriteLine ( " " ) ; Console . ReadKey ( ) ; return 0 ; }
A demo which iterates over log levels and writes messages at each.
A demo which iterates over log levels and writes messages at each .
// Initialize manager and STDOUT logger. // Iterate through the log levels. // Change the log level. // Write messages to the logger at every level.
The code to terminate the application with on exit.
The code to terminate the application with on exit .
arg
string[]
Command line arguments.
Command line arguments .