/[xmltv_parser]/trunk/xmltv_parser/main.cs
ViewVC logotype

Diff of /trunk/xmltv_parser/main.cs

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 63 by william, Fri Mar 8 14:26:48 2013 UTC revision 70 by william, Sat Mar 9 01:42:46 2013 UTC
# Line 1  Line 1 
1  ´╗┐using System;  ´╗┐#define DISABLE_RELEASE_MODE_KLOGLEVEL_DEBUG // when defined will turn off kLogLevel_Debug messages, in release mode
2    //#define DISABLE_DEBUG_MODE_KLOGLEVEL_VERBOSE_DEBUG // when defined will turn off kLogLevel_VerboseDebug message, in debug mode
3    using System;
4  using System.Collections.Generic;  using System.Collections.Generic;
5  using System.ComponentModel;  using System.ComponentModel;
6  using System.Data;  using System.Data;
# Line 18  namespace xmltv_parser Line 20  namespace xmltv_parser
20    
21      public partial class main : Form      public partial class main : Form
22      {      {
         //bool form_closing = false;  
         //private IXMLTVRuntimeInstance xmltv;  
         private bool IsUnix  
         {  
             get { return System.Environment.OSVersion.Platform == PlatformID.Unix; }  
         }  
   
23          public main()          public main()
24          {          {
25              InitializeComponent();              InitializeComponent();
# Line 33  namespace xmltv_parser Line 28  namespace xmltv_parser
28              string log_path = Application.StartupPath;              string log_path = Application.StartupPath;
29              string log_filename = string.Format("{0}.log", typeof(main).Assembly.GetName().Name);              string log_filename = string.Format("{0}.log", typeof(main).Assembly.GetName().Name);
30              gLog.CreateLog(string.Format(@"{0}\{1}", log_path, log_filename), false, LogLevel.kLogLevel_All_NoProgress, new EventHandler<LoggerOnFlushEventArgs>(Log_OnFlush));              gLog.CreateLog(string.Format(@"{0}\{1}", log_path, log_filename), false, LogLevel.kLogLevel_All_NoProgress, new EventHandler<LoggerOnFlushEventArgs>(Log_OnFlush));
31              gLog.SetLogLevel(gLog.LogLevel & ~LogLevel.kLogLevel_VerboseDebug);  #if DEBUG
32                LogLevel gLevel = gLog.LogLevel;
33    #if DISABLE_DEBUG_MODE_KLOGLEVEL_VERBOSE_DEBUG
34                gLevel &= ~LogLevel.kLogLevel_VerboseDebug;
35    #else
36                gLevel |= LogLevel.kLogLevel_VerboseDebug;
37    #endif
38                gLevel |= LogLevel.kLogLevel_Debug;
39                gLog.SetLogLevel(gLevel);
40    #else
41                LogLevel gLevel = LogLevel.kLogLevel_Default; // set the default log level: Info, Warn, Error, Debug
42                // it is OK for kLogLevel_Debug to be set in Release mode ... must of the chatty messages are from kLogLevel_VerboseDebug
43    #if DISABLE_RELEASE_MODE_KLOGLEVEL_DEBUG
44                gLevel &= ~LogLevel.kLogLevel_Debug;
45    #else
46                gLevel |= LogLevel.kLogLevel_Debug;
47    #endif
48                gLevel &= ~LogLevel.kLogLevel_VerboseDebug; // ensure this is not set, ever in release mode        
49                gLog.SetLogLevel(gLevel);
50    #endif
51    
52    
53              gLog.ReportProgressEvent += new EventHandler<ReportProgressEventArgs>(gLog_ReportProgress);              gLog.ReportProgressEvent += new EventHandler<ReportProgressEventArgs>(gLog_ReportProgress);
54          }          }
55    

Legend:
Removed from v.63  
changed lines
  Added in v.70

  ViewVC Help
Powered by ViewVC 1.1.22