public BetterLog(string path, BetterLogSettings settings) { LogSettings = settings; streamWriter = new StreamWriter(path) { AutoFlush = true }; formatter = new BetterLogFormatter(settings.Formatter); }
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); }
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); }
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); }