private static TValue FindValueFor <TValue>(LoggerName name, Dictionary <LoggerName, TValue> valuesDictionary, object defaultValue) { TValue local = (TValue)defaultValue; if (valuesDictionary.Count > 0) { using (IEnumerator <LoggerName> enumerator = name.Hierarchy.GetEnumerator()) { TValue local2; while (enumerator.MoveNext()) { LoggerName current = enumerator.Current; if (valuesDictionary.TryGetValue(current, out local2)) { goto Label_0036; } } return(local); Label_0036: local = local2; } } return(local); }
private void RegisterMessageFormatterFor(LoggerName name, MessageFormatter formatter) { if (formatter == null) { throw new ArgumentNullException("formatter"); } RegisterValueFor <MessageFormatter>(name, nameToMessageFormatterMapping, formatter); }
private void RegisterLogFor(LoggerName name, Log log) { if (log == null) { throw new ArgumentNullException("log"); } RegisterValueFor <Log>(name, nameToLogMapping, log); }
public Logger(Type type) { if (type == null) { throw new ArgumentNullException("type"); } name = new LoggerName(type); settings = Settings.Default; destinationLog = settings.FindLogFor(name); CommonInit(); }
public Logger(string name) { if (string.IsNullOrEmpty(name)) { throw new ArgumentNullException("name"); } this.name = new LoggerName(name); settings = Settings.Default; destinationLog = settings.FindLogFor(this.name); CommonInit(); }
public Logger(Type type, Settings settings) { if (type == null) { throw new ArgumentNullException("type"); } if (settings == null) { throw new ArgumentNullException("settings"); } name = new LoggerName(type); this.settings = settings; destinationLog = this.settings.FindLogFor(name); CommonInit(); }
public Logger(Type type, Log log) { if (type == null) { throw new ArgumentNullException("type"); } if (log == null) { throw new ArgumentNullException("log"); } name = new LoggerName(type); settings = Settings.Default; destinationLog = log; CommonInit(); }
public Logger(string name, Settings settings) { if (string.IsNullOrEmpty(name)) { throw new ArgumentNullException("name"); } if (settings == null) { throw new ArgumentNullException("settings"); } this.name = new LoggerName(name); this.settings = settings; destinationLog = this.settings.FindLogFor(this.name); CommonInit(); }
public Logger(string name, Log log) { if (string.IsNullOrEmpty(name)) { throw new ArgumentNullException("name"); } if (log == null) { throw new ArgumentNullException("log"); } this.name = new LoggerName(name); settings = Settings.Default; destinationLog = log; CommonInit(); }
public Logger(Type type, Log log, Settings settings) { if (type == null) { throw new ArgumentNullException("type"); } if (log == null) { throw new ArgumentNullException("log"); } if (settings == null) { throw new ArgumentNullException("settings"); } name = new LoggerName(type); this.settings = settings; destinationLog = log; CommonInit(); }
internal LogLevel FindLogLevelFor(LoggerName name) => FindValueFor <LogLevel>(name, nameToLevelMapping, defaultLevel);
internal Log FindLogFor(LoggerName name) => FindValueFor <Log>(name, nameToLogMapping, defaultLog);
internal ExceptionFormatter FindExceptionFormatterFor(LoggerName name) => FindValueFor <ExceptionFormatter>(name, nameToExceptionFormatterMapping, DefaultFormatters.Exception);
private void RegisterLogLevelFor(LoggerName name, LogLevel level) { LogLevelUtils.Valid(level, "level"); RegisterValueFor <LogLevel>(name, nameToLevelMapping, level); }
internal MessageFormatter FindMessageFormatterFor(LoggerName name) => FindValueFor <MessageFormatter>(name, nameToMessageFormatterMapping, DefaultFormatters.Message);