Beispiel #1
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 #2
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);
        }