From 0819e8369184207ca12a5e73518171d708e9d288 Mon Sep 17 00:00:00 2001 From: Martin Riedl Date: Thu, 20 Feb 2025 18:06:56 +0100 Subject: [PATCH] refactor: renamed golog to log --- README.md | 10 +++++----- cmd/simple/main.go | 4 +++- entry.go | 2 +- formatter.go | 2 +- formatter_json.go | 2 +- formatter_json_test.go | 2 +- formatter_keyvalue.go | 2 +- formatter_keyvalue_test.go | 2 +- go.mod | 2 +- level.go | 2 +- logger.go | 2 +- output.go | 2 +- printer.go | 2 +- printer_stdout.go | 2 +- 14 files changed, 20 insertions(+), 18 deletions(-) diff --git a/README.md b/README.md index bf152e2..ae24311 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,11 @@ -# goLog +# log -GoLog is a simple logging framework for golang. +Log is a simple logging framework for golang. ## Getting Started ```golang -import log "gitlab.com/martinr92/golog" +import "git.martin-riedl.de/golang/log" func main(){ log.Default.Info("My First Info Message") @@ -17,7 +17,7 @@ func main(){ Create a new log instance (instead of using the `Default`). ```golang -import log "gitlab.com/martinr92/golog" +import "git.martin-riedl.de/golang/log" var myLog := log.NewLoggerDefault() myLog.Info("My First Info Message") @@ -32,7 +32,7 @@ myLog.Info("My First Info Message") The following sample creates 2 outputs. The first sends a key/value format to stdout. The second writes messages as JSON format to stdout. ```golang -import log "gitlab.com/martinr92/golog" +import "git.martin-riedl.de/golang/log" var output1 := NewOutput(log.LevelInfo, NewFormatterKeyValue(), NewPrinterStdout() var output2 := NewOutput(log.LevelError, NewFormatterJSON(), NewPrinterStdout()) diff --git a/cmd/simple/main.go b/cmd/simple/main.go index c061fe8..2b2b224 100644 --- a/cmd/simple/main.go +++ b/cmd/simple/main.go @@ -1,7 +1,8 @@ package main import ( - log "gitlab.com/martinr92/golog" + "git.martin-riedl.de/golang/log" + "runtime" ) func main() { @@ -10,4 +11,5 @@ func main() { func someMethod() { log.Default.Info("Hello World") + log.Default.With("os", runtime.GOOS).Info("environment detected") } diff --git a/entry.go b/entry.go index ae02b5f..642c30b 100644 --- a/entry.go +++ b/entry.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package golog +package log import ( "fmt" diff --git a/formatter.go b/formatter.go index c7788cf..81a76a3 100644 --- a/formatter.go +++ b/formatter.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package golog +package log type Formatter interface { Begin(*Entry) diff --git a/formatter_json.go b/formatter_json.go index 5e063b9..4a9915d 100644 --- a/formatter_json.go +++ b/formatter_json.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package golog +package log import ( "encoding/json" diff --git a/formatter_json_test.go b/formatter_json_test.go index 8b71bb3..a39687d 100644 --- a/formatter_json_test.go +++ b/formatter_json_test.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package golog +package log import "testing" diff --git a/formatter_keyvalue.go b/formatter_keyvalue.go index 2607dce..3beb441 100644 --- a/formatter_keyvalue.go +++ b/formatter_keyvalue.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package golog +package log import ( "fmt" diff --git a/formatter_keyvalue_test.go b/formatter_keyvalue_test.go index 0faa5e7..05d0778 100644 --- a/formatter_keyvalue_test.go +++ b/formatter_keyvalue_test.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package golog +package log import "testing" diff --git a/go.mod b/go.mod index adadcf7..f953506 100644 --- a/go.mod +++ b/go.mod @@ -1,3 +1,3 @@ -module gitlab.com/martinr92/golog +module git.martin-riedl.de/golang/log go 1.20 diff --git a/level.go b/level.go index 829d2bc..db02844 100644 --- a/level.go +++ b/level.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package golog +package log type Level uint32 diff --git a/logger.go b/logger.go index 14a0430..2b88697 100644 --- a/logger.go +++ b/logger.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package golog +package log import ( "runtime" diff --git a/output.go b/output.go index 4830c50..50ec879 100644 --- a/output.go +++ b/output.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package golog +package log import "sync" diff --git a/printer.go b/printer.go index a21cd63..fc6c2d5 100644 --- a/printer.go +++ b/printer.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package golog +package log type Printer interface { Write(p []byte) diff --git a/printer_stdout.go b/printer_stdout.go index 7213e45..de39230 100644 --- a/printer_stdout.go +++ b/printer_stdout.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package golog +package log import "os"