Exemplo n.º 1
0
 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;
 }
Exemplo n.º 2
0
		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)));
		}
Exemplo n.º 3
0
		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));
		}
Exemplo n.º 4
0
 public InitializeLogger(LoggingEventBus loggingBus)
 {
     _loggingBus = loggingBus;
 }
Exemplo n.º 5
0
 public LoggingAdapter(LoggingEventBus loggingEventBus, object logClass)
     : this(loggingEventBus, logClass, LogSource.GetLogSource(logClass))
 {
 }