From 62e3eac0a97f8bd528b6e46421f3162a8d9552ff Mon Sep 17 00:00:00 2001 From: Lilleman Date: Mon, 20 Feb 2023 22:23:10 +0100 Subject: [PATCH] Better README --- README.md | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 7e98eb0..48661b0 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ ## Installation -`go get -u https://gitea.larvit.se/pwrpln/go_log` +`go get -u gitea.larvit.se/pwrpln/go_log` ## Example usage @@ -57,13 +57,20 @@ log.Info("Zep", "other", "stuff") All available options, and their defaults: ```go -loc, _ := time.LoadLocation("UTC") +loc, _ := time.LoadLocation("UTC") // See more info at https://pkg.go.dev/time#LoadLocation log := go_log.Log{ - Context: []interface{}, // Will be prepended to metadata on all log entries - MinLogLvl: go_log.Info, // Minimal log level to output - Fmt: go_log.DefaultFmt, // Log message formatter - Stderr: go_log.DefaultStderr, // Log message outputter for Debug, Verbose and Info - Stdout: go_log.DefaultStdout, // Log message outputter for Warning and Error - TimeLocation: loc, // Timestamp location/time zone setting + Context: []interface{}, // Will be prepended to metadata on all log entries + MinLogLvl: go_log.LogLvlFromStr("Info"), // Minimal log level to output + Fmt: go_log.DefaultFmt, // Log message formatter + Stderr: go_log.DefaultStderr, // Log message outputter for Debug, Verbose and Info + Stdout: go_log.DefaultStdout, // Log message outputter for Warning and Error + TimeLocation: loc, // Timestamp location/time zone setting } +``` + +Or change them after initialization like this: + +```go +log := go_log.GetLog() +log.MinLogLvl = go_log.LogLvlFromStr("Debug") ``` \ No newline at end of file