protected override void Append(LoggingEvent loggingEvent)
        {
            // This might be slow but it should not be an issue since neither Topshelf or Rhino.Licensing logs that much.
            NServiceBus.Logging.ILog Log = NServiceBus.Logging.LogManager.GetLogger(loggingEvent.LoggerName);

            if (loggingEvent.Level == Level.Debug)
            {
                Log.Debug(loggingEvent.RenderedMessage, loggingEvent.ExceptionObject);
            }
            if (loggingEvent.Level == Level.Info)
            {
                Log.Info(loggingEvent.RenderedMessage, loggingEvent.ExceptionObject);
            }
            if (loggingEvent.Level == Level.Warn)
            {
                Log.Warn(loggingEvent.RenderedMessage, loggingEvent.ExceptionObject);
            }
            if (loggingEvent.Level == Level.Error)
            {
                Log.Error(loggingEvent.RenderedMessage, loggingEvent.ExceptionObject);
            }
            if (loggingEvent.Level == Level.Fatal)
            {
                Log.Fatal(loggingEvent.RenderedMessage, loggingEvent.ExceptionObject);
            }
        }
示例#2
0
 public static void IsTrue(bool value, string message)
 {
     if (value)
     {
         return;
     }
     log.Error($"VERIFICATION-FAILED: {message}");
     if (Debugger.IsAttached)
     {
         throw new Exception(message);
     }
 }