mirror of
https://github.com/CFC-Servers/gm_logger.git
synced 2025-03-04 03:03:01 -05:00
Update readme
This commit is contained in:
parent
95fa518ad6
commit
2bbcdcd5e2
12
README.md
12
README.md
@ -61,7 +61,7 @@ Any message sent with a lower log-level than the one defined in the logger objec
|
||||
|
||||
As an example, if you set the default log level to `"error"`, then only `"error"` and `"fatal"` messages are printed.
|
||||
```lua
|
||||
require( "cfclogger" )
|
||||
require( "logger" )
|
||||
|
||||
local logger = Logger( "MyProjectName", "error" )
|
||||
|
||||
@ -84,7 +84,7 @@ Log levels can be changed after instantiation.
|
||||
For example,
|
||||
|
||||
```lua
|
||||
require( "cfclogger" )
|
||||
require( "logger" )
|
||||
local logger = Logger( "MyProjectName", "error" )
|
||||
|
||||
print( logger.logLevel )
|
||||
@ -114,7 +114,7 @@ MyLoggingInstance:on( logLevel ):call( myCallback )
|
||||
|
||||
In an example:
|
||||
```lua
|
||||
require( "cfclogger" )
|
||||
require( "logger" )
|
||||
|
||||
local function forwardFatalToDiscord( message )
|
||||
-- send the message to discord
|
||||
@ -139,7 +139,7 @@ This means that if your log level is set to `"error"`, but you add a callback to
|
||||
|
||||
As an example:
|
||||
```lua
|
||||
require( "cfclogger" )
|
||||
require( "logger" )
|
||||
|
||||
local logger = Logger( "MyProject", "fatal" )
|
||||
logger:on( "warn" ):call(function(message) print("I'm a 'warn' callback!") end)
|
||||
@ -179,7 +179,7 @@ MyProject.Storage.Logger.runParentCallbacks = true
|
||||
The Storage Logger would then inherit all callbacks set on `MyProject.Logger`
|
||||
|
||||
## Global Override
|
||||
The log level for every newly-created Logger can be overridden by setting the `cfc_logger_forced_level` convar to a log level of your choice.
|
||||
The log level for every newly-created Logger can be overridden by setting the `logger_forced_level` convar to a log level of your choice.
|
||||
|
||||
|
||||
e.g. `cfc_logger_forced_level "debug"`
|
||||
e.g. `logger_forced_level "debug"`
|
||||
|
Loading…
Reference in New Issue
Block a user