public LoggingAdapter([NotNull] LoggingEventBus loggingEventBus, [NotNull] object logClass, [NotNull] string logSource) { if (loggingEventBus == null) { throw new ArgumentNullException("loggingEventBus"); } if (logClass == null) { throw new ArgumentNullException("logClass"); } if (logSource == null) { throw new ArgumentNullException("logSource"); } if (logSource.Length == 0) { throw new ArgumentException("Log source must be specified", "logSource"); } _loggingEventBus = loggingEventBus; _logClass = logClass; _logSource = logSource; }
public static void LogDebug(this LoggingEventBus loggingEventBus, string logSource, object logClass, string message, params object[] args) { loggingEventBus.Publish(new DebugLogEvent(logSource, logClass.GetType(), StringFormat.SafeFormat(message, args))); }
public static void LogErrorException(this LoggingEventBus loggingEventBus, string logSource, object logClass, Exception exception, string message, params object[] args) { loggingEventBus.Publish(new ErrorLogEvent(logSource, logClass.GetType(), StringFormat.SafeFormat(message, args), exception)); }
public InitializeLogger(LoggingEventBus loggingBus) { _loggingBus = loggingBus; }
public LoggingAdapter(LoggingEventBus loggingEventBus, object logClass) : this(loggingEventBus, logClass, LogSource.GetLogSource(logClass)) { }