From 0062c214ab3451c09d543dff94c1355c9568d0c5 Mon Sep 17 00:00:00 2001 From: Simon Cornet Date: Thu, 6 Mar 2025 12:30:04 +0100 Subject: [PATCH] docs: improved readme --- readme.md | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/readme.md b/readme.md index 6b31a1c..4f4126d 100644 --- a/readme.md +++ b/readme.md @@ -1,24 +1,29 @@ # Logger This simple Golang package can be used for common logging functionality. +Only when debug is on, non fatal errors will be shown. -# Options - +# Install ``` -logger.SetAppName("todo-app") # optional; default "MyApp" -logger.SetDebug(true) # optional; default false +go get -u github.com/scornet256/go-logger ``` -# Usage examples +# Basic usage ``` logger.Print("Simple log message withouth error", nil) logger.Fatal("Fatal log message with error and exits the program", err) ``` -Will be printed like this: +Will output 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: +2025/12/01 11:17:35 MyApp | LOG: Simple log message withouth error +2025/12/01 11:17:35 MyApp | FATAL: Fatal log message with error +2025/12/01 11:17:35 MyApp | ERROR: +``` + +# Options +``` +logger.SetAppName("todo-app") # optional; default "MyApp" +logger.SetDebug(true) # optional; default false ``` # Return functions