示例#1
0
        internal CustomerConsoleLogger(string name, Func <string, LogLevel, bool> filter, IExternalScopeProvider scopeProvider, ConsoleLoggerProcessor loggerProcessor)
        {
            if (name == null)
            {
                throw new ArgumentNullException(nameof(name));
            }

            Name            = name;
            Filter          = filter ?? ((category, logLevel) => true);
            ScopeProvider   = scopeProvider;
            _queueProcessor = loggerProcessor;

            if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
            {
                Console = new WindowsLogConsole();
            }
            else
            {
                Console = new AnsiLogConsole(new AnsiSystemConsole());
            }
        }
示例#2
0
        public CustomConsoleLogger(string name, Func <string, LogLevel, bool> filter, bool includeScopes, ConsoleLoggerProcessor loggerProcessor)
        {
            Name          = name ?? throw new ArgumentNullException(nameof(name));
            Filter        = filter ?? ((category, logLevel) => true);
            IncludeScopes = includeScopes;

            _queueProcessor = loggerProcessor;

            if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
            {
                Console = new WindowsLogConsole();
            }
            else
            {
                Console = new AnsiLogConsole(new AnsiSystemConsole());
            }
        }
示例#3
0
 public CustomConsoleLogProvider(ConsoleLoggerProcessor processor)
 {
     _Processor = processor;
 }