public void Write(ILoggerMessage message) { using (StreamWriter sw = new StreamWriter(_file, true, Encoding.Default)) { sw.WriteLine(message.ToString()); } }
public void Write(ILoggerMessage message) { foreach (var writer in _writers) { writer.Write(message); } }
public void Write(ILoggerMessage message) { foreach (IBatchWriter writer in Writers) { writer.Write(message); } }
public void Write(ILoggerMessage message) { Parallel.ForEach(writers, writer => { writer.Write(message); }); }
public void Write(ILoggerMessage message) { //thread safe lock (lockobject) { using StreamWriter sw = File.AppendText(_file); sw.WriteLine(message.ToString()); } }
public void Log(ILoggerMessage message) { String theText = String.Format("{0}; {1}; {2}: {3}\n", message.GetTimeOfCreation().ToLongTimeString(), message.GetSource(), message.GetClassName(), message.GetMessage()); if (message.IsError) { Console.Error.Write(theText); } else { Console.Out.Write(theText); } }
public void Log(ILoggerMessage message) { Task.Run(() => { Logs sqlLogMessage = new Logs { Error = message.IsError, Message = message.GetMessage(), Source = message.GetSource(), TimeOfCreation = message.GetTimeOfCreation(), Class = message.GetClassName() }; using (Context con = new Context(config)) { con.Logs.Add(sqlLogMessage); con.SaveChanges(); } }); }
public void Write(ILoggerMessage message) { Console.WriteLine(message.ToString()); }
public ChatovatkoException(ILoggable me, String message) : base() { stackTrace = this.StackTrace; message = message + "\n" + this.GetType().Name + "\n" + this.StackTrace; theLogMessage = new DefaultLoggerMessage(me.GetType().Name, message, me.GetLogSource(), DateTime.Now, true); }
public ChatovatkoException(object me, Exception ex, String message) : base() { stackTrace = ex.StackTrace; message = message + "\n" + this.GetType().Name + "\n" + ex.Message + "\n" + ex.StackTrace; theLogMessage = new DefaultLoggerMessage(me.GetType().Name, message, "", DateTime.Now, true); }
public void Write(ILoggerMessage message) { loggerMessages.Add(message); }
public void Log(ILoggerMessage messageToSave) { throw new NotImplementedException(); }
public BufferMessage(ILoggerMessage loggerMessage, string writer) { LoggerMessage = loggerMessage; WrittenBy = writer; }
public void Log(ILoggerMessage message) { String theText = String.Format("{0}; {1}; {2}: {3}\n", message.GetTimeOfCreation().ToLongTimeString(), message.GetSource(), message.GetClassName(), message.GetMessage()); System.Diagnostics.Debug.Write(theText); }
public void Write(ILoggerMessage message) { Console.WriteLine(message); }
public static void BuffLog(this ILogger logger, ILoggerMessage loggerMessage) { var writerType = logger is BatchLogger ? typeof(FileLogWriter) : typeof(ConsoleWriter); _bufferedMessages.Add(new BufferMessage(loggerMessage, writerType.Name)); }
public void Write(ILoggerMessage message) { throw new NotImplementedException(); }
public void Write(ILoggerMessage message) { File.AppendAllText(FileName, message.ToString() + "\r\n"); }