Exemple #1
0
        /// <summary>Removes the logging levels for a log channel. If the channel does not yet exist, create it</summary>
        /// <param name="channel">The name used to identify the logging channel</param>
        /// <param name="logLevel">The logging levels that will be printed into the log channel</param>
        public static void RemoveLogLevel(string channel, LogLevel logLevel)
        {
            LogChannel ch = GetOrCreateDefault(channel);

            ch.Levels &= ~logLevel;
        }
Exemple #2
0
        /// <summary>Associates a log channel with a TextWriter. If the channel does not yet exist, create it</summary>
        /// <param name="channel">The name used to identify the logging channel</param>
        /// <param name="writer">The TextWriter to associate with the log channel</param>
        public static void Define(string channel, TextWriter writer)
        {
            LogChannel ch = GetOrCreateDefault(channel);

            ch.SetWriter(writer);
        }
Exemple #3
0
        /// <summary>Adds the logging levels for a log channel. If the channel does not yet exist, create it</summary>
        /// <param name="channel">The name used to identify the logging channel</param>
        /// <param name="logLevel">The logging levels that will be printed into the log channel</param>
        public static void AddLogLevel(string channel, LogLevel logLevel)
        {
            LogChannel ch = GetOrCreateDefault(channel);

            ch.Levels |= logLevel;
        }
Exemple #4
0
        /// <summary>Associates a log channel with a log file. If the channel does not yet exist, create it</summary>
        /// <param name="channel">The name used to identify the logging channel</param>
        /// <param name="path">The path of the log file</param>
        public static void Define(string channel, string path)
        {
            LogChannel ch = GetOrCreateDefault(channel);

            ch.SetWriter(Path.Combine(DirectoryPath, path));
        }