Click or drag to resize

HierarchicalLogger Class

A simple hierarchical logging mechanism. Multiple sub-tasks (indicated by a call to Push) can log simultaneously from different threads and the output will be serialized in the log file.
Inheritance Hierarchy
SystemObject
  AGI.Foundation.InfrastructureHierarchicalLogger

Namespace:  AGI.Foundation.Infrastructure
Assembly:  AGI.Foundation.Core (in AGI.Foundation.Core.dll) Version: 24.2.419.0 (24.2.419.0)
Syntax
public sealed class HierarchicalLogger : IDisposable

The HierarchicalLogger type exposes the following members.

Constructors
  NameDescription
Public methodHierarchicalLogger(String)
Initializes a new instance to log to a specified file.
Public methodHierarchicalLogger(TextWriter)
Initializes a new instance to log to a specified TextWriter.
Top
Properties
  NameDescription
Public propertyReportFunctionExplorerDetails
Gets or sets a value indicating whether to report details from the Function Explorers as well. Default is false.
Top
Methods
  NameDescription
Public methodDispose
Finishes logging for this sub-task and writes its output to either the log file or its parent sub-task.
Public methodEquals
Determines whether the specified object is equal to the current object.
(Inherited from Object.)
Public methodGetHashCode
Serves as the default hash function.
(Inherited from Object.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodPop
Finishes logging for this sub-task and writes its output to either the log file or its parent sub-task.
Public methodPush
Begins a new sub-task. Multiple sub-tasks can log in parallel and their output will be serialized in the log file. In other words, the log file will contain the entire output from one sub-task followed by the entire output from the next sub-task. You must call Pop or Dispose on the returned instance when the sub-task completes.
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Public methodWriteLine(String)
Writes a line of text to the log.
Public methodWriteLine(String, Object)
Writes a line of text to the log.
Top
See Also