コード例 #1
0
ファイル: Logger.cs プロジェクト: rajkumar42/MIEngine
 public static void LoadMIDebugLogger(HostConfigurationStore configStore)
 {
     if (s_logger == null)
     { 
         if (CmdLogInfo.enabled)
         {   // command configured log file
             s_logger = HostLogger.GetLoggerFromCmd(CmdLogInfo.logFile, CmdLogInfo.logToOutput);
         }
         else
         {   // use default logging
             s_logger = configStore.GetLogger("EnableMIDebugLogger", "Microsoft.MIDebug.log");
         }
         if (s_logger != null)
         {
             s_isEnabled = true;
         }
     }
 }
コード例 #2
0
ファイル: Logger.cs プロジェクト: lsgxeva/MIEngine
        public static void EnsureInitialized(HostConfigurationStore configStore)
        {
            if (!s_isInitialized)
            {
                s_isInitialized = true;
                s_initTime = DateTime.Now;

                s_logger = configStore.GetLogger("EnableMIDebugLogger", "Microsoft.MIDebug.log");
                if (s_logger != null)
                {
                    s_isEnabled = true;
                }
                WriteLine("Initialized log at: " + s_initTime);
            }

#if DEBUG
            if (System.Diagnostics.Debugger.IsAttached)
            {
                s_isEnabled = true;
            }
#endif
        }
コード例 #3
0
ファイル: Logger.cs プロジェクト: wesrupert/MIEngine
 public static void LoadMIDebugLogger(HostConfigurationStore configStore)
 {
     if (s_logger == null)
     {
         s_logger = configStore.GetLogger("EnableMIDebugLogger", "Microsoft.MIDebug.log");
         if (s_logger != null)
         {
             s_isEnabled = true;
         }
     }
 }
コード例 #4
0
ファイル: HostLogger.cs プロジェクト: rajkumar42/MIEngine
 /// <summary>
 /// Get a logger after the user has explicitly configured a log file/callback
 /// </summary>
 /// <param name="logFileName"></param>
 /// <param name="callback"></param>
 /// <returns>The host logger object</returns>
 public static HostLogger GetLoggerFromCmd(string logFileName, HostLogger.OutputCallback callback)
 {
     StreamWriter writer = HostLogger.GetStreamForName(logFileName, throwInUseError: true);
     return new HostLogger(writer, callback);
 }
コード例 #5
0
ファイル: HostLogger.cs プロジェクト: Trass3r/MIEngine
        /// <summary>
        /// Get a logger after the user has explicitly configured a log file/callback
        /// </summary>
        /// <param name="logFileName"></param>
        /// <param name="callback"></param>
        /// <returns>The host logger object</returns>
        public static HostLogger GetLoggerFromCmd(string logFileName, HostLogger.OutputCallback callback)
        {
            StreamWriter writer = HostLogger.GetStreamForName(logFileName, throwInUseError: true);

            return(new HostLogger(writer, callback));
        }