Show / Hide Table of Contents

Namespace DevInstance.LogScope

Classes

DefaultScopeLogFactory

Factory class to instantiate a scope manager. Here is the example how to create console default logger:

    var manager = DefaultScopeLogFactory.Create(LogLevel.DEBUG, myprovider, myformatter);
}
Another example how to create custom provider and formatter:
    var manager = DefaultScopeLogFactory.CreateConsoleLogger(LogLevel.DEBUG);
}

LoggingExtensions

The goals of extension functions is to maintain simplicity and keep the code clean.

Interfaces

ILogProvider

ILogProvider defines the log provider interface.

IScopeFormatter

IScopeFormatter defines the formatter interface. Every scope has start and end, can contain nested scope and lines between start an end. In addition to it, every scope can log the time of execution. Formatter interfaces describes the contract for developing customize formatter.

IScopeLog

Logging scope. Scope can be method or a specific part of it. The implementation is based on IDisposable where calling Dispose ends the scope. This the core interface where most of the "magic" happens.

IScopeManager

IScopeManager defines the log manager. Use DefaultScopeLogFactory or ServiceExtensions.

Enums

LogLevel

Log level defines the severity of the log. Logging level is optional and depends on the provider's implementation. LoggingExtensions for the helping methods to make it easier to use.

In This Article
Back to top Generated by DocFX