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; } } }
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 }
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; } } }
/// <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); }
/// <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)); }