Exemplo n.º 1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="LoggerWrapper" /> class.
        /// </summary>
        /// <param name="provider">The function that provides the value for the <see cref="LoggerWrapper.BaseLogger" /> property.</param>
        /// <param name="syncRoot">The custom object for thread safe operations.</param>
        /// <exception cref="ArgumentNullException">
        /// <paramref name="provider" /> is <see langword="null" />.
        /// </exception>
        public LoggerWrapper(LoggerProvider provider, object syncRoot = null)
            : base(syncRoot: syncRoot)
        {
            if (provider == null)
            {
                throw new ArgumentNullException("provider");
            }

            _PROVIDER = provider;
        }
Exemplo n.º 2
0
        /// <summary>
        /// Creates a new Server instance.
        /// </summary>
        /// <param name="version">Version the server is running. <i>(independent of minecraft version)</i></param>
        public Server(Config config, string version, int serverId)
        {
            this.Config = config;

            ServerImplementationRegistry.RegisterServerImplementations();

            this.LoggerProvider = new LoggerProvider(LogLevel.Debug);
            this.Logger         = this.LoggerProvider.CreateLogger($"Server/{this.Id}");
            // This stuff down here needs to be looked into
            Globals.PacketLogger = this.LoggerProvider.CreateLogger("Packets");
            PacketDebug.Logger   = this.LoggerProvider.CreateLogger("PacketDebug");
            Registry.Logger      = this.LoggerProvider.CreateLogger("Registry");

            this.Port    = config.Port;
            this.Version = version;
            this.Id      = serverId;

            this.tcpListener = new TcpListener(IPAddress.Any, this.Port);

            this.clients = new ConcurrentHashSet <Client>();

            this.cts = new CancellationTokenSource();

            this.chatMessages = new ConcurrentQueue <QueueChat>();
            this.placed       = new ConcurrentQueue <PlayerBlockPlacement>();

            Logger.LogDebug("Initializing command handler...");
            this.Commands = new CommandHandler("/");

            Logger.LogDebug("Registering commands...");
            this.Commands.RegisterCommandClass <MainCommandModule>();

            Logger.LogDebug("Registering custom argument parsers...");
            this.Commands.AddArgumentParser(new LocationTypeParser());
            this.Commands.AddArgumentParser(new PlayerTypeParser());

            Logger.LogDebug("Registering command context type...");
            this.Commands.RegisterContextType <ObsidianContext>();
            Logger.LogDebug("Done registering commands.");

            this.Events = new MinecraftEventHandler();

            this.PluginManager = new PluginManager(Events, this, LoggerProvider.CreateLogger("Plugin Manager"));

            this.Operators = new OperatorList(this);

            this.World = new World("world", this);

            this.Events.PlayerLeave += this.OnPlayerLeave;
            this.Events.PlayerJoin  += this.OnPlayerJoin;
            this.Events.ServerTick  += this.OnServerTick;
        }
Exemplo n.º 3
0
        public bool FixAndSave()
        {
            bool flag = this.TryFix();

            if (flag && (this.logNumber < 100))
            {
                object[] args = new object[] { GetPath(this.tr), Time.frameCount, this.userId, this.logNumber };
                LoggerProvider.GetLogger(typeof(PhysicsUtil)).ErrorFormat("NanFixer fix {0} at frame {1}, user: {2}, logNumber: {3}", args);
                this.logNumber++;
            }
            this.SaveState();
            return(flag);
        }
Exemplo n.º 4
0
        public CommandsSender(EngineService engineService, NetworkService networkService, ComponentAndEventRegistrator componentAndEventRegistrator, SharedEntityRegistry entityRegistry)
        {
            this.networkService   = networkService;
            this.entityRegistry   = entityRegistry;
            this.commandCollector = new CommandCollector();
            this.logger           = LoggerProvider.GetLogger(this);
            EventCommandCollector     eventListener     = new EventCommandCollector(this.commandCollector, componentAndEventRegistrator, entityRegistry);
            ComponentCommandCollector componentListener = new ComponentCommandCollector(this.commandCollector, componentAndEventRegistrator, entityRegistry);

            engineService.AddFlowListener(this);
            engineService.AddComponentListener(componentListener);
            engineService.AddEventListener(eventListener);
        }
Exemplo n.º 5
0
 public void Init(NodeAddedEvent evt, NotInitedCharacterShadowNode node, [JoinAll] SingleNode <CharacterShadowCommonSettingsComponent> characterShadowCommonSettings)
 {
     if (!node.characterShadowCasters.HasBounds)
     {
         LoggerProvider.GetLogger(this).Error("Incorrect character shadow elements on gameObject " + node.characterShadow.gameObject.name);
     }
     else
     {
         CharacterShadowInternalComponent shadowInternalData = new CharacterShadowInternalComponent();
         this.CalculateShadowInternalData(shadowInternalData, node.characterShadow, characterShadowCommonSettings.component);
         node.Entity.AddComponent(shadowInternalData);
     }
 }
Exemplo n.º 6
0
        public async Task Async_Error_Log_Call_Shoould_Write_File_Expected_Message__And_Path()
        {
            string message         = LoggerProvider.CreateLogMessage(MessageLength.Normal);
            string expectedMessage = $"{_dateTimeProviderMock.UtcNow} [ERROR] {message}";

            using (var stream = _streamFactoryMock.Create())
            {
                var streamLogger = new StreamLogger(stream, _dateTimeProviderMock, _streamWriterMock);
                await streamLogger.LogAsync(LogLevel.Error, message);

                await _streamWriterMock.Received().WriteLineAsync(Arg.Any <Stream>(), Arg.Is(expectedMessage));
            }
        }
 public AssetBundleDiskCacheTask(AssetBundleDiskCache _assetBundleDiskCache)
 {
     this.assetBundleDiskCache = _assetBundleDiskCache;
     this.state2action.Add(AssetBundleDiskCacheState.INIT, new Action(this.Initialize));
     this.state2action.Add(AssetBundleDiskCacheState.START_LOAD_FROM_HTTP, new Action(this.StartLoadFromHTTP));
     this.state2action.Add(AssetBundleDiskCacheState.LOADING_FROM_HTTP, new Action(this.LoadingFromHTTP));
     this.state2action.Add(AssetBundleDiskCacheState.START_LOAD_FROM_DISK, new Action(this.StartLoadFromDisk));
     this.state2action.Add(AssetBundleDiskCacheState.START_WRITE_TO_DISK, new Action(this.StartWriteToDisk));
     this.state2action.Add(AssetBundleDiskCacheState.WRITE_TO_DISK, new Action(this.WriteToDisk));
     this.state2action.Add(AssetBundleDiskCacheState.CREATE_ASSETBUNDLE, new Action(this.CreateAssetBundle));
     this.state2action.Add(AssetBundleDiskCacheState.COMPLETE, new Action(this.Complete));
     this.Log = LoggerProvider.GetLogger(this);
 }
Exemplo n.º 8
0
        public Program([NotNull] IApplicationEnvironment appEnv)
        {
            Check.NotNull(appEnv, "appEnv");

            _projectDir    = appEnv.ApplicationBasePath;
            _rootNamespace = appEnv.ApplicationName;

            var loggerProvider = new LoggerProvider(name => new ConsoleCommandLogger(name, verbose: true));
            var assemblyName   = new AssemblyName(appEnv.ApplicationName);
            var assembly       = Assembly.Load(assemblyName);

            _migrationTool = new MigrationTool(loggerProvider, assembly);
        }
Exemplo n.º 9
0
        private ContentManager(Game game, string dataPackageName, string contentPath)
        {
            _game = game;

            _contentPath = contentPath;

            _loadedPackages   = new List <Package>();
            _dataPackageNames = new List <string> {
                dataPackageName
            };

            _logger = LoggerProvider.GetLogger();
        }
Exemplo n.º 10
0
        // Constructors
        internal Logger(LoggerProvider loggerProvider)
        {
            #region Contracts

            if (loggerProvider == null)
            {
                throw new ArgumentException();
            }

            #endregion

            // Default
            _loggerProvider = loggerProvider;
        }
Exemplo n.º 11
0
        public Server(Game game, string host, ushort port, string configJson)
        {
            _logger     = LoggerProvider.GetLogger();
            _game       = game;
            _serverPort = port;
            _serverHost = host;
            _config     = Config.LoadFromJson(game, configJson);

            _blowfishKeys = new Dictionary <ulong, string>();
            foreach (var player in _config.Players)
            {
                _blowfishKeys.Add(player.Value.PlayerID, player.Value.BlowfishKey);
            }
        }
Exemplo n.º 12
0
 public static void InitDefaultCursor(Texture2D cursorTexture, Vector2 cursorHotspot)
 {
     if (cursorTexture != null)
     {
         defaultCursorData.hotspot = cursorHotspot;
         defaultCursorData.texture = cursorTexture;
     }
     else
     {
         LoggerProvider.GetLogger(typeof(Cursors)).Error("CursorService:InitDefaultCursor argument 'cursorTexture' is null");
         defaultCursorData.hotspot = Vector2.zero;
         defaultCursorData.texture = null;
     }
 }
Exemplo n.º 13
0
        public OperationExecutor([NotNull] object logHandler, [NotNull] IDictionary args)
        {
            Check.NotNull(logHandler, nameof(logHandler));
            Check.NotNull(args, nameof(args));

            var unwrappedLogHandler = ForwardingProxy.Unwrap <IOperationLogHandler>(logHandler);
            var loggerProvider      = new LoggerProvider(name => new CommandLoggerAdapter(name, unwrappedLogHandler));

            var targetName        = (string)args["targetName"];
            var startupTargetName = (string)args["startupTargetName"];
            var environment       = (string)args["environment"];
            var projectDir        = (string)args["projectDir"];
            var rootNamespace     = (string)args["rootNamespace"];

            var startupAssembly = Assembly.Load(new AssemblyName(startupTargetName));

            Assembly assembly;

            try
            {
                assembly = Assembly.Load(new AssemblyName(targetName));
            }
            catch (Exception ex)
            {
                throw new OperationException(CommandsStrings.UnreferencedAssembly(targetName, startupTargetName), ex);
            }

            _contextOperations = new LazyRef <DbContextOperations>(
                () => new DbContextOperations(
                    loggerProvider,
                    assembly,
                    startupAssembly,
                    projectDir, environment));
            _databaseOperations = new LazyRef <DatabaseOperations>(
                () => new DatabaseOperations(
                    loggerProvider,
                    assembly,
                    startupAssembly,
                    environment,
                    projectDir,
                    rootNamespace));
            _migrationsOperations = new LazyRef <MigrationsOperations>(
                () => new MigrationsOperations(
                    loggerProvider,
                    assembly,
                    startupAssembly,
                    environment,
                    projectDir,
                    rootNamespace));
        }
        static RtMemoryCacheProvider()
        {
            Log = LoggerProvider.LoggerFor(typeof(RtMemoryCacheProvider));
            ConfiguredCachesProperties = new Dictionary <string, IDictionary <string, string> >();

            if (!(ConfigurationManager.GetSection("rtmemorycache") is CacheConfig[] list))
            {
                return;
            }
            foreach (var cache in list)
            {
                ConfiguredCachesProperties.Add(cache.Region, cache.Properties);
            }
        }
Exemplo n.º 15
0
        private void Log(string message, Exception e)
        {
            string str    = "ClientUpdateError: " + message;
            ILog   logger = LoggerProvider.GetLogger(this);

            if (e == null)
            {
                logger.Error(str);
            }
            else
            {
                logger.Error(str, e);
            }
        }
Exemplo n.º 16
0
        private ContentManager(Game game, string gameModeName, string contentPath)
        {
            _contentPath = contentPath;
            _game        = game;
            _logger      = LoggerProvider.GetLogger();

            GameModeName = gameModeName;

            _content = new Dictionary <string, Dictionary <string, List <string> > >();
            foreach (var contentType in ContentTypes)
            {
                _content[contentType] = new Dictionary <string, List <string> >();
            }
        }
Exemplo n.º 17
0
        static SysCacheProvider()
        {
            log    = LoggerProvider.LoggerFor(typeof(SysCacheProvider));
            caches = new Dictionary <string, ICache>();

            var list = ConfigurationManager.GetSection("syscache") as CacheConfig[];

            if (list != null)
            {
                foreach (CacheConfig cache in list)
                {
                    caches.Add(cache.Region, new SysCache(cache.Region, cache.Properties));
                }
            }
        }
Exemplo n.º 18
0
 public static void AddForceAtPositionSafe(this Rigidbody rigidbody, Vector3 force, Vector3 position)
 {
     if (!IsValidVector3(force))
     {
         LoggerProvider.GetLogger(typeof(PhysicsUtil)).WarnFormat("Invalid add force (Vector3, Vector3). Parameter <force> StackTrace:[{0}]", Environment.StackTrace);
     }
     else if (!IsValidVector3(position))
     {
         LoggerProvider.GetLogger(typeof(PhysicsUtil)).WarnFormat("Invalid add force (Vector3, Vector3). Parameter <position> StackTrace:[{0}]", Environment.StackTrace);
     }
     else
     {
         rigidbody.AddForceAtPosition(force, position);
     }
 }
Exemplo n.º 19
0
        private Application(IWindsorContainer container)
        {
            ApplicationId = AppSettings.ApplicationId ?? Guid.NewGuid().ToString();
            ApplicationType = AppSettings.ApplicationType ?? string.Empty;
            ApplicationGroup = AppSettings.ApplicationGroup ?? string.Empty;

            Container = container;
            LoggerProvider = Container.Resolve<ILoggerProvider>();
            Logger = LoggerProvider.GetLogger(ApplicationLoggerName);

            Logger.Info(string.Format("初始化当前应用程序[{0}]", ApplicationId));

            ComponentHost = new ComponentHost(Logger);
            ComponentHost.Install(Container);
        }
Exemplo n.º 20
0
 public DependencyResult CheckNodeReferences()
 {
     try
     {
         if (DependencyResult == null)
         {
             ServiceContext = new ServiceContextOfUser();
         }
         DependencyResult = ServiceContext.Init();
     }
     catch (Exception ex)
     {
         LoggerProvider.GetLog4netLogger("ServiceLog").Error(ex.ToString());
     }
     return(DependencyResult);
 }
Exemplo n.º 21
0
        private static void ConsoleLoggerTest(LoggerFactory loggerFactory)
        {
            var logger = loggerFactory.CreateConsoleLogger(new ConsoleWrapper());

            logger.Log(LogLevel.Debug, LoggerProvider.CreateLogMessage(MessageLength.Normal));
            logger.Log(LogLevel.Info, LoggerProvider.CreateLogMessage(MessageLength.Normal));

            try
            {
                logger.Log(LogLevel.Info, LoggerProvider.CreateLogMessage(MessageLength.ExtraLarge));
            }
            catch (Exception ex)
            {
                logger.Log(LogLevel.Error, ex.Message);
            }
        }
Exemplo n.º 22
0
        public UnbufferedLoggerProviderTests()
        {
            _messagesHandler = new MockHttpMessageHandler();

            _provider = new LoggerProvider(new LoggerOptions()
            {
                Uri                = "http://www.fakeadress.com",
                SourceName         = "LoggerProviderTestSourceName",
                SourceCategory     = "LoggerProviderTestSourceCategory",
                SourceHost         = "LoggerProviderTestSourceHost",
                IsBuffered         = false,
                HttpMessageHandler = _messagesHandler,
            });

            _logger = _provider.CreateLogger("OverriddenCategory");
        }
Exemplo n.º 23
0
        public static IActionResult Run(
            [HttpTrigger(AuthorizationLevel.Function, "POST", Route = null)]
            HttpRequest httpRequest,
            TraceWriter traceWriter)
        {
            IActionResult toReturn = null;

            LoggerProvider loggerProvider = new LoggerProvider(traceWriter);

            toReturn = FunctionLogicHarness.Execute <Models.UpdatePersonBody.Person>(
                httpRequest,
                new LoggerProvider(traceWriter),
                PerformPersonValidation,
                PerformUpdatePerson);

            return(toReturn);
        }
Exemplo n.º 24
0
        static MemoryCacheProvider()
        {
            log    = LoggerProvider.LoggerFor(typeof(MemoryCacheProvider));
            caches = new Dictionary <string, ICache>();

            var list = ConfigurationManager.GetSection("memorycache") as CacheConfig[];

            if (list == null)
            {
                return;
            }

            foreach (var cache in list)
            {
                caches.Add(cache.Region, new MemoryCache(cache.Region, cache.Properties));
            }
        }
Exemplo n.º 25
0
        public virtual void Invoke(IList <HandlerInvokeData> otherInvokeArguments)
        {
            int count = this.handlerExecutors.Count;

            for (int i = 0; i < count; i++)
            {
                HandlerExecutor executor = this.handlerExecutors[i];
                if ((this.handlerVersion == this.Handler.Version) || this.CheckMethodArgumentsIsActual(executor.ArgumentForMethod))
                {
                    this.handlerExecutors[i].Execute();
                }
                else if (this.Handler.Mandatory)
                {
                    LoggerProvider.GetLogger <Flow>().Warn("Mandatory handler skiped by context change " + this.Handler);
                }
            }
        }
Exemplo n.º 26
0
        public static void Start(string[] args)
        {
            int interval = int.Parse(ConfigurationManager.AppSettings["interval"]) * 1000;
            var user     = ConfigurationManager.AppSettings["user"];
            var pass     = ConfigurationManager.AppSettings["pass"];

            var logWriters = new List <ILogBatchWriter>();

            if (Environment.UserInteractive)
            {
                logWriters.Add(new ConsoleBatchWriter());
            }
            var elasticsearchURL  = ConfigurationManager.AppSettings["ElasticsearchUrl"];
            var elasticsearchUser = ConfigurationManager.AppSettings["ElasticsearchUser"];
            var elasticsearchPass = ConfigurationManager.AppSettings["ElasticsearchPass"];

            logWriters.Add(new ElasticsearchBatchWriter(elasticsearchURL, "mailsender", elasticsearchUser, elasticsearchPass));
            var loggerProvider = new LoggerProvider((cat, logLevel) => logLevel >= LogLevel.Information, false, new LoggerBatchingProcessor(logWriters));
            var gmailSender    = new GmailSender(loggerProvider.CreateLogger <GmailSender>(), user, pass);

            var config = new Config()
            {
                SubjectTemplateFileNameSubfix = ConfigurationManager.AppSettings["SubjectTemplateFileNameSubfix"],
                BodyTemplateFileNameSubfix    = ConfigurationManager.AppSettings["BodyTemplateFileNameSubfix"],
                MailFolderPath      = ConfigurationManager.AppSettings["MailFolderPath"],
                EmailKey            = ConfigurationManager.AppSettings["EmailKey"],
                PurposeKey          = ConfigurationManager.AppSettings["PurposeKey"],
                ProcessedFolderName = ConfigurationManager.AppSettings["ProcessedFolderName"],
                TemplateFolderPath  = ConfigurationManager.AppSettings["TemplateFolderPath"],
                Interval            = interval
            };

            var processor = new EmailTemplateProcessor.EmailTemplateProcessor(gmailSender,
                                                                              loggerProvider.CreateLogger <EmailTemplateProcessor.EmailTemplateProcessor>(), config);

            if (processor.Start() == false)
            {
                return;
            }

            if (Environment.UserInteractive == true)
            {
                Console.Read();
            }
        }
Exemplo n.º 27
0
        public void Setup()
        {
            var logSettings = new LogSettings
            {
                LogLevel = new Dictionary <string, LogLevel>
                {
                    { "DarkwingDuck", LogLevel.Warning },
                    { "LaunchpadMcQuack", LogLevel.Trace },
                },
                IgnoredCategories = new List <string>
                {
                    "MegaVolt"
                }
            };

            _logWriterFake  = A.Fake <ILogWriter>();
            _classUnderTest = new LoggerProvider(logSettings, _logWriterFake);
        }
Exemplo n.º 28
0
        public AttackableUnit(
            IGame game,
            string model,
            IStats stats,
            int collisionRadius = 40,
            float x             = 0,
            float y             = 0,
            int visionRadius    = 0,
            uint netId          = 0
            ) : base((Game)game, x, y, collisionRadius, visionRadius, netId)

        {
            Logger          = LoggerProvider.GetLogger();
            Stats           = stats;
            Model           = model;
            CollisionRadius = 40;
            Stats.AttackSpeedMultiplier.BaseValue = 1.0f;
        }
Exemplo n.º 29
0
        private static void ConfigureLog4Net()
        {
            var hierarchy = (Hierarchy)LogManager.GetRepository(typeof(TestsContext).Assembly);

            var consoleAppender = new ConsoleAppender
            {
                Layout = new PatternLayout("%d{ABSOLUTE} %-5p %c{1}:%L - %m%n"),
            };

            hierarchy.Root.Level = log4net.Core.Level.Warn;
            hierarchy.Root.AddAppender(consoleAppender);
            hierarchy.Configured = true;
#if !NETFX
#pragma warning disable 618
            LoggerProvider.SetLoggersFactory(new Log4NetLoggerFactory());
#pragma warning restore 618
#endif
        }
Exemplo n.º 30
0
        public Program([NotNull] IServiceProvider serviceProvider,
                       [NotNull] IApplicationEnvironment appEnv, [NotNull] ILibraryManager libraryManager)
        {
            Check.NotNull(serviceProvider, nameof(serviceProvider));
            Check.NotNull(appEnv, nameof(appEnv));
            Check.NotNull(libraryManager, nameof(libraryManager));

            _projectDir    = appEnv.ApplicationBasePath;
            _rootNamespace = appEnv.ApplicationName;

            var loggerProvider = new LoggerProvider(name => new ConsoleCommandLogger(name, verbose: true));
            var assemblyName   = new AssemblyName(appEnv.ApplicationName);
            var assembly       = Assembly.Load(assemblyName);

            _migrationTool  = new MigrationTool(loggerProvider, assembly);
            _databaseTool   = new DatabaseTool(serviceProvider, loggerProvider);
            _libraryManager = libraryManager;
        }
        public UnbufferedLoggerProviderTests()
        {
            _messagesHandler = new MockHttpMessageHandler();

            _provider = new LoggerProvider(new LoggerOptions()
            {
                Uri                  = "http://www.fakeadress.com",
                SourceName           = "LoggerProviderTestSourceName",
                SourceCategory       = "LoggerProviderTestSourceCategory",
                SourceHost           = "LoggerProviderTestSourceHost",
                IsBuffered           = false,
                HttpMessageHandler   = _messagesHandler,
                MinLogLevel          = LogLevel.Debug,
                MessageFormatterFunc = (message, ex, category, level, scopedProperties) => message
            });

            _logger = _provider.CreateLogger("OverriddenCategory");
        }
Exemplo n.º 32
0
 /// <summary>
 /// Initializes a new instance of the <see cref="FallbackLogger" /> class.
 /// </summary>
 /// <param name="baseProvider">The function that provides the main / base logger.</param>
 /// <param name="fallbackLogger">The fallback logger.</param>
 /// <exception cref="ArgumentNullException">
 /// <paramref name="baseProvider" /> and/or <paramref name="fallbackLogger" /> is <see langword="null" />.
 /// </exception>
 public FallbackLogger(LoggerProvider baseProvider, ILogger fallbackLogger)
     : this(baseProvider: baseProvider,
            fallbackProvider: CreateProvider(fallbackLogger))
 {
 }
Exemplo n.º 33
0
 /// <summary>
 /// Sets the function that provides the value for <see cref="Logger.Current" /> property.
 /// </summary>
 /// <param name="provider">The new provider.</param>
 public static void SetProvider(LoggerProvider provider)
 {
     _provider = provider;
 }
Exemplo n.º 34
0
 /// <summary>
 /// Initializes a new instance of the <see cref="SynchronizedLogger" /> class.
 /// </summary>
 /// <param name="provider">The function that provides the value for the <see cref="LoggerWrapper.BaseLogger" /> property.</param>
 /// <param name="syncRoot">The custom object for thread safe operations.</param>
 /// <exception cref="ArgumentNullException">
 /// <paramref name="provider" /> is <see langword="null" />.
 /// </exception>
 public SynchronizedLogger(LoggerProvider provider, object syncRoot = null)
     : base(provider: provider,
            syncRoot: syncRoot)
 {
 }
Exemplo n.º 35
0
        /// <summary>
        /// Initializes a new instance of the <see cref="FallbackLogger" /> class.
        /// </summary>
        /// <param name="baseProvider">The function that provides the main / base logger.</param>
        /// <param name="fallbackProvider">The function that provides the fallback logger.</param>
        /// <exception cref="ArgumentNullException">
        /// <paramref name="baseProvider" /> and/or <paramref name="fallbackProvider" /> is <see langword="null" />.
        /// </exception>
        public FallbackLogger(LoggerProvider baseProvider, LoggerProvider fallbackProvider)
            : base(provider: baseProvider)
        {
            if (fallbackProvider == null)
            {
                throw new ArgumentNullException("fallbackProvider");
            }

            _FALLBACK_PROVIDER = fallbackProvider;
        }
Exemplo n.º 36
0
 /// <summary>
 /// Initializes a new instance of the <see cref="AsyncLogger" /> class.
 /// </summary>
 /// <param name="provider">The function that provides the value for the <see cref="LoggerWrapper.BaseLogger" /> property.</param>
 /// <exception cref="ArgumentNullException">
 /// <paramref name="provider" /> is <see langword="null" />.
 /// </exception>
 public AsyncLogger(LoggerProvider provider)
     : base(provider: provider)
 {
 }
Exemplo n.º 37
0
 /// <summary>
 /// Initializes a new instance of the <see cref="FallbackLogger" /> class.
 /// </summary>
 /// <param name="baseLogger">The main / base logger.</param>
 /// <param name="fallbackProvider">The function that provides the fallback logger.</param>
 /// <exception cref="ArgumentNullException">
 /// <paramref name="baseLogger" /> and/or <paramref name="fallbackProvider" /> is <see langword="null" />.
 /// </exception>
 public FallbackLogger(ILogger baseLogger, LoggerProvider fallbackProvider)
     : this(baseProvider: CreateProvider(baseLogger),
            fallbackProvider: fallbackProvider)
 {
 }