internal LogData(WebSocketSharp.LogLevel level, StackFrame caller, string message) { this._level = level; this._caller = caller; this._message = message ?? string.Empty; this._date = DateTime.Now; }
public Logger(WebSocketSharp.LogLevel level, string file, Action <LogData, string> output) { this._level = level; this._file = file; this._output = output ?? new Action <LogData, string>(Logger.defaultOutput); this._sync = new object(); }
private void output(string message, WebSocketSharp.LogLevel level) { object obj = this._sync; Monitor.Enter(obj); try { if (this._level <= level) { LogData logDatum = null; try { logDatum = new LogData(level, new StackFrame(2, true), message); this._output(logDatum, this._file); } catch (Exception exception1) { Exception exception = exception1; logDatum = new LogData(WebSocketSharp.LogLevel.Fatal, new StackFrame(0, true), exception.Message); Console.WriteLine(logDatum.ToString()); } } } finally { Monitor.Exit(obj); } }
public Logger(WebSocketSharp.LogLevel level) : this(level, null, null) { }
public static void SetLevel(WebSocketSharp.LogLevel level) { _getInstance().Level = level; }