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