Update README.md
This commit is contained in:
parent
772c7389a8
commit
6144297a3c
1 changed files with 4 additions and 13 deletions
17
README.md
17
README.md
|
@ -1,4 +1,4 @@
|
|||
# LybLog - A simple logger for beeflang
|
||||
# LybLog - A simple threadsafe logger for beeflang
|
||||
|
||||
```cs
|
||||
namespace MyProgram;
|
||||
|
@ -37,7 +37,7 @@ class Program
|
|||
6. Go to Properties -> Dependencies and check the box that says LybLog
|
||||
7. In the file you want to use the logger add a using LybLog statement or simply say LybLog.Log.Methodname(Message). You can now use LybLog in your project
|
||||
|
||||
- Alternativly you can also just copy the single sourcefile into your project, since its
|
||||
- Alternativly you can also just copy the single sourcefile into your project.
|
||||
|
||||
### Basics
|
||||
- LybLog is a singleton and has somewhat resonable default settings, so for its default usage you can simply just call the basic functions and pass in your message and it will work fine for you. The basic functions provided are: Trace, Debug, Info, Warn, Error and Fatal
|
||||
|
@ -46,7 +46,6 @@ class Program
|
|||
- Debug: Information, such as variable values used to debug the program.
|
||||
- Info: General information about the programs state, like a system that has been loaded sucessfully or wether the program connected to a server.
|
||||
- Warn: Something is not how it is supposed to be but the program can still continue and might be able to ignore it, but might also error in the future.
|
||||
- Error: An error occured and now a part of the program wont execute correctly. It might still be possible to recover from this.
|
||||
- Fatal: An error occured that forces the entire program to stop
|
||||
|
||||
### Preprocessor
|
||||
|
@ -58,17 +57,9 @@ Settings that start with "Do" toggle the thing they are about, such as wether it
|
|||
Settings also provides a color option for the console, alllows the user to set the logfilepath and has an option to clear the logfile on every new program start.
|
||||
```
|
||||
Log.Settings.DoConsoleLog = true;
|
||||
Log.Settings.DoIdeLog = true;
|
||||
Log.Settings.Colors.Debug = .Blue;
|
||||
Log.Settings.LogFilePath = ".log";
|
||||
Log.Settings.DoFileLog = true;
|
||||
```
|
||||
### Callbacks
|
||||
Callbacks are a way for the user to get information back about when something is being logged.
|
||||
Settings has a callback even object which the user can register events to that will be called when a log function is called.
|
||||
```
|
||||
Log.Settings.Callbacks.Add(new => MyMethodName);
|
||||
```
|
||||
The callback itself gets the log level of the message aswell as an unformatted message string and can do with that whatever it wants.
|
||||
|
||||
### Formatter
|
||||
As a user you may need a custom formatter so the settings object also has an IFormatter interface, which you can inherit from to create your own message formatter.
|
||||
The callback itself gets the log level of the message aswell as an unformatted message string and can do with that whatever it wants.
|
Loading…
Add table
Reference in a new issue