private void output(string message, LogLevel level) { lock (_sync) { if (_level > level) return; LogData data = null; try { data = new LogData (level, new StackFrame (2, true), message); _output (data, _file); } catch (Exception ex) { data = new LogData (LogLevel.Fatal, new StackFrame (0, true), ex.Message); Console.WriteLine (data.ToString ()); } } }
private static void defaultOutput(LogData data, string path) { var log = data.ToString (); Console.WriteLine (log); if (path != null && path.Length > 0) writeToFile (log, path); }