public static void StartLogging() { #if DEBUG if(!cBlnIsLogging) { if(Logger != null) Logger.Close(); Logger = BasicTextLogger.Create(LogFile, BasicTextLogger.MessageType.all); Logger.WriteLine(BasicTextLogger.MessageType.info, "AutoClose starting."); cBlnIsLogging = true; return; } #else if (Properties.Settings.Default.Log) { if (!cBlnIsLogging) { if (Logger != null) Logger.Close(); Logger = BasicTextLogger.Create(LogFile, BasicTextLogger.MessageType.all); Logger.WriteLine(BasicTextLogger.MessageType.info, "AutoClose starting."); cBlnIsLogging = true; } } else { Logger = BasicTextLogger.CreateDummy(); cBlnIsLogging = false; } #endif }
/// <summary> /// Create a debugger, initialises the file stream and stream writter ready for outputting to /// </summary> /// <param name="iOwnerApp">Owner App for this logger instance. Set to null of no App is associated.</param> /// <param name="iFullPath">Full path of the log file to create.</param> /// <param name="iMessageTypes">The type of messages that you would like logged, anything else is ignored.</param> /// <returns></returns> public static BasicTextLogger Create(String iFullPath, MessageType iMessageTypes) { BasicTextLogger pBTLLogger = new BasicTextLogger(iFullPath, iMessageTypes); return(pBTLLogger); }
/// <summary> /// Create a debugger, initialises the file stream and stream writter ready for outputting to /// </summary> /// <param name="iOwnerApp">Owner App for this logger instance. Set to null of no App is associated.</param> /// <param name="iFullPath">Full path of the log file to create.</param> /// <param name="iMessageTypes">The type of messages that you would like logged, anything else is ignored.</param> /// <returns></returns> public static BasicTextLogger Create(String iFullPath, MessageType iMessageTypes) { BasicTextLogger pBTLLogger = new BasicTextLogger(iFullPath, iMessageTypes); return (pBTLLogger); }
/// <summary> /// Create an instance of a dummy logger that doesn't output anything /// </summary> /// <returns></returns> public static BasicTextLogger CreateDummy() { BasicTextLogger pBTLLogger = new BasicTextLogger(); return(pBTLLogger); }
/// <summary> /// Create an instance of a dummy logger that doesn't output anything /// </summary> /// <returns></returns> public static BasicTextLogger CreateDummy() { BasicTextLogger pBTLLogger = new BasicTextLogger(); return (pBTLLogger); }