Npgsql.Tests.TestBase.SetupLogging C# (CSharp) Method

SetupLogging() protected method

protected SetupLogging ( ) : void
return void
        protected virtual void SetupLogging()
        {
#if LOGGING_ENABLED
            var config = new LoggingConfiguration();
            var consoleTarget = new ConsoleTarget
            {
                Layout = @"${message} ${exception:format=tostring}"
            };
            config.AddTarget("console", consoleTarget);
            var rule = new LoggingRule("*", LogLevel.Debug, consoleTarget);
            config.LoggingRules.Add(rule);
            NLog.LogManager.Configuration = config;

            if (!_loggingSetUp)
            {
                NpgsqlLogManager.Provider = new NLogLoggingProvider();
                NpgsqlLogManager.IsParameterLoggingEnabled = true;
                _loggingSetUp = true;
            }
#endif
        }