feat: initial commit
This commit is contained in:
commit
693724d3b8
7 changed files with 116 additions and 0 deletions
28
readme.md
Normal file
28
readme.md
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
# Logger
|
||||
|
||||
This simple Golang package can be used for common logging functionality.
|
||||
|
||||
# Options
|
||||
|
||||
```
|
||||
logger.SetAppName("todo-app") # optional; default "MyApp"
|
||||
logger.SetDebug(true) # optional; default false
|
||||
```
|
||||
|
||||
# Usage examples
|
||||
```
|
||||
logger.Print("Simple log message withouth error", nil)
|
||||
logger.Fatal("Fatal log message with error", err)
|
||||
|
||||
```
|
||||
Will be printed like this:
|
||||
```
|
||||
2025/12/01 11:17:35 todo-app | LOG: Simple log message withouth error
|
||||
2025/12/01 11:17:35 todo-app | FATAL: Fatal log message with error
|
||||
2025/12/01 11:17:35 todo-app | ERROR: <insert value of err>
|
||||
```
|
||||
|
||||
# Return functions
|
||||
```
|
||||
logger.GetAppName() will return the current used app name as a string.
|
||||
logger.GetDebug() will return the current debug setting as a bool.
|
||||
Loading…
Add table
Add a link
Reference in a new issue