using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Windows.Forms; using Enterprise.Logging; namespace libxmltv.Core { internal class xmltv_logger { public static void Initialize() { try { string log_path = Application.StartupPath; string log_filename = string.Format("{0}.log", typeof(xmltv_logger).Assembly.GetName().Name); gLog.CreateLog(string.Format(@"{0}\{1}", log_path, log_filename), false, LogLevel.kLogLevel_All); } catch (Exception) { /* This will always thrown an exception, if gLog was initialized prior to calling xmltv_logger.Initialize() This is mostly here to allow us to initialize it, if it was not already initialized */ } } public static void SetLogLevel(int loglvl) { SetLogLevel((LogLevel)loglvl); } public static void SetLogLevel(LogLevel loglvl) { gLog.SetLogLevel(loglvl); } public static ilogger Debug { get { return gLog.Debug; } } public static ilogger Error { get { return gLog.Error; } } public static ilogger Info { get { return gLog.Info; } } public static ilogger Warn { get { return gLog.Warn; } } public static ilog Verbose { get { return gLog.Verbose; } } } }