public void ShowException(string msg) { AppendMessage(msg); ITraceLog log = TraceLogClass.TraceLog; log.Log(msg, ref bShowMessage); }
public TestTraceLogContext(string name) { log = new TraceLog <GenericEventId>(name); var source = log.TraceSource; listener = source.Listeners.OfType <TestTraceListener>().First(); listener.MethodCallInformation.Clear(); }
/// <summary> /// Lookup the wrapper objects for the loggers specified /// </summary> /// <param name="loggers">the loggers to get the wrappers for</param> /// <returns>Lookup the wrapper objects for the loggers specified</returns> private static ITraceLog[] WrapLoggers(log4net.Core.ILogger[] loggers) { ITraceLog[] results = new ITraceLog[loggers.Length]; for (int i = 0; i < loggers.Length; i++) { results[i] = WrapLogger(loggers[i]); } return(results); }
/// <summary> /// Initializes a new instance of the <see cref="TraceBlock"/> class. /// </summary> /// <param name="logger">The underlying logger to use.</param> /// <param name="methodName">The name of the method that is being traced;</param> /// <param name="message"></param> public TraceBlock(ITraceLog logger, string methodName, string message) { this.logger = logger; this.methodName = methodName; if (this.logger.IsTraceEnabled) { this.logger.TraceFormat("Entering {0}: {1}", methodName, message); } }
/// <summary> /// Liefert alle Wrapper-Objekte für die angegebenen Logger <paramref name="loggers"/>. /// </summary> /// <param name="loggers">Arary von ILogger-Objekten, für die die Wrapper-Objekte zu liefern sind.</param> /// <returns>Ein Array von ITraceLog Wrapper-Objekten.</returns> public static ITraceLog[] WrapLoggers(ILogger[] loggers) { var results = new ITraceLog[loggers.Length]; for (var i = 0; i < loggers.Length; i++) { results[i] = WrapLogger(loggers[i]); } return(results); }
public void Enqueue(ITraceLog traceLog, LoggingEventWrapper loggingEvent) { lock (s_locker) { base.Enqueue(loggingEvent); if (Count >= m_flushThreshold) { Flush(traceLog); } } }
public Boolean LogTrace(ITraceLog traceLog) { TTraceLog entity = LogTraceCore(traceLog.Description, traceLog.MethodName, traceLog.StatusCode); if (entity == null) { return(false); } return(Save()); }
static public void ShowError2(string msg) { if (thisMessageWindow != null) { thisMessageWindow.ShowException(msg); } else { ITraceLog log = TraceLogClass.TraceLog; log.Log(msg); } }
static public void AppendMessage2(string msg) { if (thisMessageWindow != null) { thisMessageWindow.AppendMessage(msg); } else { ITraceLog log = TraceLogClass.TraceLog; log.Log(msg); } }
static public void ShowException2(Exception e) { if (thisMessageWindow != null) { thisMessageWindow.ShowException(e); } else { ITraceLog log = TraceLogClass.TraceLog; log.Log(e); } }
public ExcelImportBootstrapper() { //To check: use Assembly.GetExecutingAssembly().CodeBase or Assembly.GetExecutingAssembly().Locatioon? string dllstr = Path.GetDirectoryName(Assembly.GetExecutingAssembly().CodeBase); string dllDirectory = new Uri(dllstr).LocalPath; // set Environment.CurrentDirectory so later when FileInfo is allocated it will // use the value Environment.CurrentDirectory as its Directory property to find config/uaclient.xml Environment.CurrentDirectory = dllDirectory; Prediktor.Log.Log4NetLog.Configure(); LogManager.TraceLogFactory = (name) => new Prediktor.Log.Log4NetLog(name); _log = LogManager.GetLogger(typeof(ExcelImportBootstrapper)); }
public void Flush(ITraceLog traceLog) { LoggingEventWrapper[] loggingEvents = null; lock (s_locker) { loggingEvents = ToArray(); Clear(); } foreach (var loggingEvent in loggingEvents) { traceLog.Logger.Log(loggingEvent); } }
public Logger(ITraceLog traceLog, Level level) { m_traceLog = traceLog; m_level = level; m_timeEntered = new QueryPerfCounter(true); m_logIsEnabled = m_traceLog.Logger.IsEnabledFor(m_level); m_callerStackDeclaringType = null; m_method = ""; m_methodBase = null; if (m_logIsEnabled) { Log(EnterString + ' ' + Method); } }
public Log4netLogger(ITraceLog log) { this._log = log; }
/// <summary> /// Change the logger based on the settings /// </summary> /// <param name="logger"></param> public static void SetLogger(ITraceLog logger) { s_logger = logger; }
public void ShowException(Exception e) { ITraceLog log = TraceLogClass.TraceLog; AppendMessage(log.Log(this.FindForm(), e, ref bShowMessage)); }
/// <summary> /// Initializes a new instance of the <see cref="TraceBlock"/> class. /// </summary> /// <param name="logger">The underlying logger to use.</param> /// <param name="methodName">The name of the method that is being traced;</param> /// <param name="message"></param> public TraceBlock(ITraceLog logger, string methodName, string message) { this.logger = logger; this.methodName = methodName; if (this.logger.IsTraceEnabled) { this.logger.TraceFormat("Entering {0}: {1}", methodName, message); } }
/// <summary> /// Lookup the wrapper objects for the loggers specified /// </summary> /// <param name="loggers">the loggers to get the wrappers for</param> /// <returns>Lookup the wrapper objects for the loggers specified</returns> private static ITraceLog[] WrapLoggers(ILogger[] loggers) { ITraceLog[] results = new ITraceLog[loggers.Length]; for(int i=0; i<loggers.Length; i++) { results[i] = WrapLogger(loggers[i]); } return results; }
public Logger(ITraceLog traceLog) : this(traceLog, Level.Debug) { }