static void Main(string[] args) { try { // Initialize MetroLog using the defaults LogManagerFactory.DefaultConfiguration.AddTarget(LogLevel.Trace, LogLevel.Fatal, new StreamingFileTarget()); ILogManager logManager = LogManagerFactory.DefaultLogManager; // Inject the ILogManager manually SomeMagicClass c = new SomeMagicClass(logManager); c.DoMagic(); } finally { // If we have a debugger, stop so you can see the output if (Debugger.IsAttached) Console.ReadKey(); } }
static void Main(string[] args) { try { // Initialize MetroLog using the defaults LogManagerFactory.DefaultConfiguration.AddTarget(LogLevel.Trace, LogLevel.Fatal, new StreamingFileTarget()); ILogManager logManager = LogManagerFactory.DefaultLogManager; // Inject the ILogManager manually SomeMagicClass c = new SomeMagicClass(logManager); c.DoMagic(); } finally { // If we have a debugger, stop so you can see the output if (Debugger.IsAttached) { Console.ReadKey(); } } }