ChaseLabs.Logger
0.2.1.1
There is a newer version of this package available.
See the version list below for details.
See the version list below for details.
dotnet add package ChaseLabs.Logger --version 0.2.1.1
NuGet\Install-Package ChaseLabs.Logger -Version 0.2.1.1
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="ChaseLabs.Logger" Version="0.2.1.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add ChaseLabs.Logger --version 0.2.1.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: ChaseLabs.Logger, 0.2.1.1"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install ChaseLabs.Logger as a Cake Addin #addin nuget:?package=ChaseLabs.Logger&version=0.2.1.1 // Install ChaseLabs.Logger as a Cake Tool #tool nuget:?package=ChaseLabs.Logger&version=0.2.1.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
CLLogger
An easy to use file logging system.
Create Logger
Default Values
- Log files path defaults to "exe-directory/logs/latest.log"
- Minimum log type defaults to "All Log Levels"
- Default pattern is "[ %TYPE%: %DATE% ]: %MESSAGE%"
- Default dump type is No Dump
- Default dump interval is 10 seconds
Default Logger
ILog log = LogManager.Init();
Default Logger with modified path
// This file and directories will be created for you.
ILog log = LogManager.Init().SetLogDirectory("relative/or/absolute/path/to/latest.log");
Default Logger with modified minimum log type
Log Types
- All
- Debug
- Info
- Warn
- Error
- Fatal
// This will only show logs at and above info
// Ex: Info, Warn, Error, Fatal
ILog log = LogManager.Init().SetMinimumLogType(LogTypes.Info);
Default Logger with modified pattern
Pattern variables
- %TYPE% = Log Type
- %DATE% = Current Date and Time down to the millisecond
- %MESSAGE% = The actual log message
// [DEBUG: 1/01/2000 5:00:00 PM]: Hello World
ILog log = LogManager.Init().SetPattern("[%TYPE%: %DATE%]: %MESSAGE%");
Default Logger with modified dump type
Dump Types
- NoDump = Will never write log to file
- NoBuffer = Will write to file as soon as it was written to console
- Interval = Will dump all cached logs every x milliseconds
ILog log = LogManager.Init().SetDumpMethod(DumpType.NoBuffer);
If you want a interval of 5 seconds or 5000 milliseconds
ILog log = LogManager.Init().SetDumpMethod(DumpType.Interval, 5000);
You can also use just the interval and it will automatically be DumpType of Interval
ILog log = LogManager.Init().SetDumpMethod(5000);
Create Log
Send Info Log Message
log.Info("Hello World");
Send Multiple Messages
log.Info("Hello World", "Good Bye World");
Send Error Message with exception
try {
/// Something that fails
} catch(Exception e) {
log.Error("Hello World", e);
}
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net6.0
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Updated README