SystemExt.Demo/Log.cs
/// <summary>
/// A demo which iterates over a series of tokens and logs them to a stream.
/// </summary>
/// <param name="arg">
/// Command line arguments.
/// </param>
/// <returns>
/// The code to terminate the application with on exit.
/// </returns>
A demo which iterates over a series of tokens and logs them to a stream.
A demo which iterates over a series of tokens and logs them to a stream .
private static int LogComponents(string[] arg)
        {
            var manager = new LogManager();
            var logger = new StreamLogger(Console.OpenStandardOutput());
            foreach (var logToken in new[] { "*", "INVALID DEMO2", "DEMO1 -DEMO2", "* -DEMO2 -* INVALID" })
            {
                manager.AddLogger(logToken, LogLevel.Verbose, logger);
                Console.WriteLine("Component filter set to {0}", logToken);
                manager.Write(LogLevel.Verbose, "DEMO1", "Logging with the DEMO1 component!");
                manager.Write(LogLevel.Verbose, "DEMO2", "Logging with the DEMO2 component!");
                manager.Write(LogLevel.Verbose, manager, "Logging with the LogManager component!");
            }
            Console.WriteLine("Press any key to exit.");
            Console.ReadKey();
            return 0;
        }
private static int LogComponents ( string [ ] arg ) { var manager = new LogManager ( ) ; var logger = new StreamLogger ( Console . OpenStandardOutput ( ) ) ; foreach ( var logToken in new [ ] { " " , " " , " " , " " } ) { manager . AddLogger ( logToken , LogLevel . Verbose , logger ) ; Console . WriteLine ( " " , logToken ) ; manager . Write ( LogLevel . Verbose , " " , " " ) ; manager . Write ( LogLevel . Verbose , " " , " " ) ; manager . Write ( LogLevel . Verbose , manager , " " ) ; } Console . WriteLine ( " " ) ; Console . ReadKey ( ) ; return 0 ; }
A demo which iterates over a series of tokens and logs them to a stream.
A demo which iterates over a series of tokens and logs them to a stream .
// Initialize manager and STDOUT logger. // Iterate over various log tokens.
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 .