public void Init() { Directory.CreateDirectory(_tempDirectory); _configManager = new RuntimeConfigManager() { ConfigDirectory = _tempDirectory }; var config = new LoggingConfig() { LoggerConfigs = new List <ModuleLoggerConfig>() { new ModuleLoggerConfig() { LoggerName = "Test" } } }; _configManager.SaveConfiguration(config); _management = new ServerLoggerManagement() { ConfigManager = _configManager }; _host = new ModuleManager() { ConfigManager = _configManager, LoggerManagement = _management }; _management.ActivateLogging(_host); }
/// <summary> /// Deactivate logging for a plugin /// </summary> public void DeactivateLogging(ILoggingHost module) { var logger = (module.Logger as Logger); logger?.ClearChildren(); module.Logger = new IdleLogger(module.Name, CreateLogTarget(module.Name)); }
/// <summary> /// Deactivate logging for a Module /// </summary> /// <param name="module"/> public void DeactivateLogging(ILoggingHost module) { }
/// <summary> /// Activate logging for a Module /// </summary> /// <param name="module"/> public void ActivateLogging(ILoggingHost module) { Name = module.Name; ActiveLevel = LogLevel.Info; module.Logger = this; }
/// <summary> /// Activate logging for a module /// </summary> public void ActivateLogging(ILoggingHost module) { var logger = GetOrCreateLogger(module.Name, module.GetType()); module.Logger = logger; }