Skip to content
This repository was archived by the owner on Jul 27, 2021. It is now read-only.

Zolmex/async-logger

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Async Logger

A simple asynchronous logging engine in C#.

How to use

There are a couple ways to use this logger.

  • Adding the .dll to project references. (fastest)
    • Download the latest .dll on releases.
    • Right-click on 'Dependencies' (or 'References' if you're working on .NET Framework) of the project you want to add the logger to, click 'Add Project Reference', go to 'Browse', then 'Browse...'(on the bottom), find and select the .dll file and click 'Accept', then 'Ok' and you're done.
    • Last, right-click the project and go to 'Manage NuGet packages'. Click on 'Browse' and install 'Newtonsoft.Json'.
  • If you wish to have the source code at hand.
    • Add the 'AsyncLogger' folder to the solution and add the project to it as well. How to add an exisisting project to a Solution.
    • After adding the project to the solution, right-click the project and go to 'Manage NuGet packages'. Click on 'Browse' and install 'Newtonsoft.Json'.
    • Note: If you want other projects to use the logger, right-click on 'Dependencies' (or 'References' if you're working on .NET Framework) of the project you want, click 'Add Project Reference' and select the AsyncLogger project.

For the simplest of uses, you can look at RedisBackup for guidance.

logConfig.json

[
  {
    "LoggerName": "DefaultLogger",
    "LogDir": "/logs/.../",
    "LevelConfigs": [
      {
        "BackgroundColor": 0,
        "ForegroundColor": 7
      },
      [...]
    ]
  }
]
  • LoggerName: Name of the logger. Loggers that have this name will have this configuration.
    • Note: Logger names that don't have configuration use the DefaultLogger configuration.
  • LogDir: Directory for the log files and folders to be created.
  • LevelConfigs: Configuration for each log level.
    • BackgroundColor: Color for the back of the log message.
    • ForegroundColor: Color for the text of the log message.

About

A simple asynchronous logging engine in C#.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages