private static ILogBuilder CreateBuilder(LogLevel logLevel, string callerFilePath) { string name = GetName(callerFilePath); var writer = ResolveWriter(); var builder = new LogBuilder(logLevel, writer); builder.Logger(name); MergeProperties(builder); return(builder); }
private static LogBuilder CreateBuilder(LogLevel logLevel, string callerFilePath) { string name = LoggerExtensions.GetFileNameWithoutExtension(callerFilePath ?? string.Empty); var writer = ResolveWriter(); var builder = new LogBuilder(logLevel, writer); builder.Logger(name); MergeProperties(builder); return(builder); }
private static void MergeProperties(LogBuilder builder) { // copy global properties to current builder only if it has been created if (_globalProperties.IsValueCreated) { foreach (var pair in _globalProperties.Value) { builder.Property(pair.Key, pair.Value); } } // copy thread-local properties to current builder only if it has been created if (_threadProperties.IsValueCreated) { foreach (var pair in _threadProperties.Value) { builder.Property(pair.Key, pair.Value); } } }