public void log(string msg, int lvl, LoggingException e, LogType l, params Object[] p) { if (lvl <= this._maxLvl) { Logging.logStream(Console.Out, msg, lvl, e, l, p); } }
public static void logStream(TextWriter _s, string msg, int lvl, LoggingException e, LogType l, params Object[] p) { msg = string.Format(msg, p) + ((e != null) ? Environment.NewLine + e.Message + Environment.NewLine + e.StackTrace : ""); string dispMsg = ""; int i = 0; string pf = ""; foreach (string s in msg.Split('\n')) { if (msg.Trim().Length == 0) { dispMsg += pf; i = 0; } else { dispMsg += pf + ((i++ == 0) ? "" : "\t") + s.Trim(); pf = Environment.NewLine; } } dispMsg.Split('\n').ToList().ForEach( m => _s.WriteLine( DateTime.Now.ToString("yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK") + ": " + ((l != LogType.Information) ? l.ToString() + " : " : "") + m ) ); }
public void log(string msg, int lvl, LoggingException e, LogType l, params Object[] p) { if (lvl <= this._maxLvl) { EventLog.WriteEntry(this._source, string.Format(msg, p) + ((e != null) ? Environment.NewLine + e.StackTrace : ""), d[l]); } }
void ILoggingService.log(string msg, int lvl, LoggingException e, LogType l, params Object[] p) { Logging.log(msg, lvl, e, l, p); ILoggingServiceCallback callback = OperationContext.Current.GetCallbackChannel<ILoggingServiceCallback>(); if (callback != null) callback.Logged(); }
public static void log(string msg, int lvl, LoggingException e, LogType l, params Object[] p) { foreach (ILogging il in Logging._l) { if (!il.ignore()) { il.log(msg, lvl, e, l, p); } } }
public void log(string msg, int lvl, LoggingException e, LogType l, params Object[] p) { lock (this._s) { if (lvl <= this._maxLvl) { this._s.AppendLine(DateTime.Now.ToString("yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK") + ": " + ((l != LogType.Information) ? l.ToString() + " : " : "") + string.Format(msg, p) + ((e != null) ? Environment.NewLine + e.StackTrace : "")); } } }
public void log(string msg, int lvl, LoggingException e, LogType l, params Object[] p) { if (lvl <= this._maxLvl) { using (StreamWriter sw = File.AppendText(this._fileName))// Creates or opens and appends { Logging.logStream(sw, msg, lvl, e, l, p); } } }
public void log(string msg, int lvl, LoggingException e, LogType l, params object[] p) { myWeb.ILoggingService pipeProxy = pipeFactory.CreateChannel(); ((IClientChannel)pipeProxy).Open(); try { pipeProxy.log(msg, lvl, e, l, p); } catch { ((IClientChannel)pipeProxy).Abort(); } finally { ((IClientChannel)pipeProxy).Close(); } }
public void log(string msg, int lvl, LoggingException e, LogType l, params Object[] p) { if (lvl <= this._maxLvl) EventLog.WriteEntry(this._source, string.Format(msg, p) + ((e != null) ? Environment.NewLine + e.StackTrace : ""), d[l]); }
public void log(string msg, int lvl, LoggingException e, LogType l, params Object[] p) { lock (this._s) { if (lvl <= this._maxLvl) this._s.AppendLine(DateTime.Now.ToString("yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK") + ": " + ((l != LogType.Information) ? l.ToString() + " : " : "") + string.Format(msg, p) + ((e != null) ? Environment.NewLine + e.StackTrace : "")); } }
public static void log(string msg, int lvl, LoggingException e, LogType l, params Object[] p) { foreach (ILogging il in Logging._l) { if (!il.ignore()) il.log(msg, lvl, e, l, p); } }