/// <summary> /// Closes the scope. /// </summary> /// <param name="scope">The scope to finish.</param> internal static void CloseScope(LogScope scope) { lock (m_lock) { if (CurrentScope == scope && scope != m_root) { CurrentScope = scope.Parent; } m_log_instances.Remove(scope.InstanceID); } }
/// <summary> /// Initializes a new instance of the <see cref="T:Duplicati.Library.Logging.LogWrapper"/> class. /// </summary> /// <param name="self">The log instance to wrap.</param> public LogScope(ILog self, LogMessageType level, LogScope parent) { Log = self; LogLevel = level; Parent = parent; if (parent != null) { Logging.Log.StartScope(this); } }
/// <summary> /// Initializes a new instance of the <see cref="T:Duplicati.Library.Logging.LogWrapper"/> class. /// </summary> /// <param name="self">The log instance to wrap.</param> /// <param name="filter">The log filter to use</param> public LogScope(ILogDestination self, ILogFilter filter, LogScope parent) { Parent = parent; m_log = self; m_filter = filter; if (parent != null) { Logging.Log.StartScope(this); } }
/// <summary> /// Starts the scope. /// </summary> /// <param name="scope">The scope to start.</param> internal static void StartScope(LogScope scope) { CurrentScope = scope; }