Beispiel #1
0
 public BetterLog(string path, BetterLogSettings settings)
 {
     LogSettings  = settings;
     streamWriter = new StreamWriter(path)
     {
         AutoFlush = true
     };
     formatter = new BetterLogFormatter(settings.Formatter);
 }
Beispiel #2
0
        internal static ILog SetupModLog(string path, string name, BetterLogSettings settings)
        {
            if (!settings.Enabled)
            {
                return(null);
            }

            var log = Logger.GetLogger(name);

            Logger.AddAppender(name, new BetterLog(path, settings));
            Logger.SetLoggerLevel(name, settings.Level);

            return(log);
        }
Beispiel #3
0
        internal static BetterLogger SetupModLog(string path, string name, BetterLogSettings settings)
        {
            if (!settings.Enabled)
            {
                return(new BetterLogger(null, LogLevel.Error));
            }

            var log      = Logger.GetLogger(name);
            var appender = new BetterLog(path, settings);

            Logger.AddAppender(name, appender);
            Logger.SetLoggerLevel(name, settings.Level);
            var logger = new BetterLogger(log, settings.Level);

            return(logger);
        }
Beispiel #4
0
        internal static ILog SetupModLog(string path, string name, BetterLogSettings settings)
        {
            if (!settings.Enabled)
            {
                return(null);
            }

            var log      = Logger.GetLogger(name);
            var appender = new BetterLog(path, settings);

            Logger.AddAppender(name, appender);
            Logger.SetLoggerLevel(name, settings.Level);
            //Logger.IsLogging = true; // workaround for logging being disabled in debug build?!?

            return(log);
        }