예제 #1
0
 public void Write(string message, LogLevel logLevel)
 {
     if ((logLevel > LogLevel.Debug) || Common.Flags.Verbose)
     {
         _logger.Log(GetLogLevel(logLevel), message);
     }
 }
예제 #2
0
            public void Write(string message, LogLevel logLevel)
            {
                if (logLevel < Level)
                    return;

                lock (locker) File.AppendAllText(path, message + "\r\n");
            }
예제 #3
0
파일: UpdateLogger.cs 프로젝트: Dadoum/osu
        public void Write(string message, LogLevel logLevel)
        {
            if (logLevel < Level)
            {
                return;
            }

            logger.Add(message);
        }
            public void Write(string message, LogLevel logLevel)
            {
                if (logLevel < Level)
                {
                    return;
                }

                if (logger == null)
                {
                    logger = Logger.GetLogger("updater");
                }

                logger.Add(message);
            }
예제 #5
0
 static NLog.LogLevel GetLogLevel(LogLevel logLevel) {
     switch (logLevel) {
     case LogLevel.Debug:
         return NLog.LogLevel.Debug;
     case LogLevel.Info:
         return NLog.LogLevel.Info;
     case LogLevel.Warn:
         return NLog.LogLevel.Warn;
     case LogLevel.Error:
         return NLog.LogLevel.Error;
     case LogLevel.Fatal:
         return NLog.LogLevel.Fatal;
     default:
         throw new ArgumentOutOfRangeException(nameof(logLevel), logLevel, null);
     }
 }
예제 #6
0
        public void Write(string message, LogLevel logLevel)
        {
            switch (logLevel)
            {
            case LogLevel.Debug:
            {
                Logger.Debug(message);
                break;
            }

            case LogLevel.Info:
            {
                Logger.Info(message);
                break;
            }

            case LogLevel.Error:
            {
                Logger.Error(message);
                break;
            }

            case LogLevel.Fatal:
            {
                Logger.Fatal(message);
                break;
            }

            case LogLevel.Warn:
            {
                Logger.Warn(message);
                break;
            }

            default:
                throw new ArgumentOutOfRangeException(nameof(logLevel), logLevel, null);
            }
        }
예제 #7
0
        static NLog.LogLevel GetLogLevel(LogLevel logLevel)
        {
            switch (logLevel)
            {
            case LogLevel.Debug:
                return(NLog.LogLevel.Debug);

            case LogLevel.Info:
                return(NLog.LogLevel.Info);

            case LogLevel.Warn:
                return(NLog.LogLevel.Warn);

            case LogLevel.Error:
                return(NLog.LogLevel.Error);

            case LogLevel.Fatal:
                return(NLog.LogLevel.Fatal);

            default:
                throw new ArgumentOutOfRangeException(nameof(logLevel), logLevel, null);
            }
        }
예제 #8
0
 public void Write(string message, LogLevel logLevel)
 {
     logger.Log(NLogLogLevelToSplatLogLevel(logLevel), message);
 }
예제 #9
0
 public void Write(string message, LogLevel logLevel) {
     _logger.Log(GetLogLevel(logLevel), message);
 }
        private static global::Exceptionless.Logging.LogLevel RxUitoExceptionlessLevel(LogLevel logLevel)
        {
            var mappings = new[]
            {
                new Tuple <LogLevel, global::Exceptionless.Logging.LogLevel>(LogLevel.Debug, global::Exceptionless.Logging.LogLevel.Debug),
                new Tuple <LogLevel, global::Exceptionless.Logging.LogLevel>(LogLevel.Info, global::Exceptionless.Logging.LogLevel.Info),
                new Tuple <LogLevel, global::Exceptionless.Logging.LogLevel>(LogLevel.Warn, global::Exceptionless.Logging.LogLevel.Warn),
                new Tuple <LogLevel, global::Exceptionless.Logging.LogLevel>(LogLevel.Error, global::Exceptionless.Logging.LogLevel.Error),
                new Tuple <LogLevel, global::Exceptionless.Logging.LogLevel>(LogLevel.Fatal, global::Exceptionless.Logging.LogLevel.Error)
            };

            return(mappings.First(x => x.Item1 == logLevel).Item2);
        }
 /// <summary>
 /// Writes a message at the specified log level
 /// </summary>
 /// <param name="message">The message to write.</param>
 /// <param name="logLevel">The log level to write the message at.</param>
 public void Write(String message, LogLevel logLevel)
 {
     this.CreateLog(message, RxUitoExceptionlessLevel(logLevel));
 }
예제 #12
0
 /// <summary>Writes a messge to the target.</summary>
 /// <param name="message">The message.</param>
 /// <param name="type">The type.</param>
 /// <param name="logLevel">The log level.</param>
 public void Write(string message, Type type, LogLevel logLevel)
 {
     logger.Log(NLogLogLevelToSplatLogLevel(logLevel), message, type);
 }
예제 #13
0
 public void Write(string message, LogLevel logLevel) {
     if ((logLevel > LogLevel.Debug) || Common.Flags.Verbose)
         _logger.Log(GetLogLevel(logLevel), message);
 }