コード例 #1
0
ファイル: LoggingAdapter.cs プロジェクト: HCanber/Aktris
 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;
 }
コード例 #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)));
		}
コード例 #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));
		}
コード例 #4
0
ファイル: InitializeLogger.cs プロジェクト: HCanber/Aktris
 public InitializeLogger(LoggingEventBus loggingBus)
 {
     _loggingBus = loggingBus;
 }
コード例 #5
0
ファイル: LoggingAdapter.cs プロジェクト: HCanber/Aktris
 public LoggingAdapter(LoggingEventBus loggingEventBus, object logClass)
     : this(loggingEventBus, logClass, LogSource.GetLogSource(logClass))
 {
 }