Simple Golang package for common logging requirements
- Go 100%
|
All checks were successful
ci/woodpecker/push/linting Pipeline was successful
This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [actions/checkout](https://github.com/actions/checkout) | action | major | `v4` → `v6` | --- ### Release Notes <details> <summary>actions/checkout (actions/checkout)</summary> ### [`v6.0.3`](https://github.com/actions/checkout/blob/HEAD/CHANGELOG.md#v603) [Compare Source](https://github.com/actions/checkout/compare/v6.0.2...v6.0.3) - Fix checkout init for SHA-256 repositories by [@​yaananth](https://github.com/yaananth) in [#​2439](https://github.com/actions/checkout/pull/2439) - fix: expand merge commit SHA regex and add SHA-256 test cases by [@​yaananth](https://github.com/yaananth) in [#​2414](https://github.com/actions/checkout/pull/2414) ### [`v6.0.2`](https://github.com/actions/checkout/blob/HEAD/CHANGELOG.md#v602) [Compare Source](https://github.com/actions/checkout/compare/v6.0.1...v6.0.2) - Fix tag handling: preserve annotations and explicit fetch-tags by [@​ericsciple](https://github.com/ericsciple) in [#​2356](https://github.com/actions/checkout/pull/2356) ### [`v6.0.1`](https://github.com/actions/checkout/blob/HEAD/CHANGELOG.md#v601) [Compare Source](https://github.com/actions/checkout/compare/v6...v6.0.1) - Add worktree support for persist-credentials includeIf by [@​ericsciple](https://github.com/ericsciple) in [#​2327](https://github.com/actions/checkout/pull/2327) ### [`v6.0.0`](https://github.com/actions/checkout/blob/HEAD/CHANGELOG.md#v600) [Compare Source](https://github.com/actions/checkout/compare/v6...v6) - Persist creds to a separate file by [@​ericsciple](https://github.com/ericsciple) in [#​2286](https://github.com/actions/checkout/pull/2286) - Update README to include Node.js 24 support details and requirements by [@​salmanmkc](https://github.com/salmanmkc) in [#​2248](https://github.com/actions/checkout/pull/2248) ### [`v6`](https://github.com/actions/checkout/blob/HEAD/CHANGELOG.md#v603) [Compare Source](https://github.com/actions/checkout/compare/v5.0.1...v6) - Fix checkout init for SHA-256 repositories by [@​yaananth](https://github.com/yaananth) in [#​2439](https://github.com/actions/checkout/pull/2439) - fix: expand merge commit SHA regex and add SHA-256 test cases by [@​yaananth](https://github.com/yaananth) in [#​2414](https://github.com/actions/checkout/pull/2414) ### [`v5.0.1`](https://github.com/actions/checkout/blob/HEAD/CHANGELOG.md#v501) [Compare Source](https://github.com/actions/checkout/compare/v5...v5.0.1) - Port v6 cleanup to v5 by [@​ericsciple](https://github.com/ericsciple) in [#​2301](https://github.com/actions/checkout/pull/2301) ### [`v5.0.0`](https://github.com/actions/checkout/blob/HEAD/CHANGELOG.md#v500) [Compare Source](https://github.com/actions/checkout/compare/v5...v5) - Update actions checkout to use node 24 by [@​salmanmkc](https://github.com/salmanmkc) in [#​2226](https://github.com/actions/checkout/pull/2226) ### [`v5`](https://github.com/actions/checkout/blob/HEAD/CHANGELOG.md#v501) [Compare Source](https://github.com/actions/checkout/compare/v4.3.1...v5) - Port v6 cleanup to v5 by [@​ericsciple](https://github.com/ericsciple) in [#​2301](https://github.com/actions/checkout/pull/2301) </details> --- ### Configuration 📅 **Schedule**: (UTC) - Branch creation - At any time (no schedule defined) - Automerge - At any time (no schedule defined) 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0My4xOTEuMiIsInVwZGF0ZWRJblZlciI6IjQzLjIwOS4yIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6W119--> Reviewed-on: #2 |
||
|---|---|---|
| .github | ||
| .woodpecker | ||
| .editorconfig | ||
| .gitattributes | ||
| .gitignore | ||
| .goreleaser.yaml | ||
| debug.go | ||
| LICENSE | ||
| logging.go | ||
| prefix.go | ||
| readme.md | ||
| renovate.json | ||
Logger
This simple Golang package can be used for common logging functionality. Only when debug is on, non fatal errors will be shown.
Install
go get -u git.simoncor.net/golang/logger
Basic usage
logger.Print("Simple log message withouth error", nil)
logger.Fatal("Fatal log message with error and exits the program", err)
Will output like this:
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: <insert value of err>
Options
logger.SetAppName("todo-app") # optional; default "MyApp"
logger.SetDebug(true) # optional; default false
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.