{"id":20906023,"url":"https://github.com/telanflow/logger","last_synced_at":"2025-10-16T23:41:43.046Z","repository":{"id":57504078,"uuid":"230439414","full_name":"telanflow/logger","owner":"telanflow","description":"Go logger library","archived":false,"fork":false,"pushed_at":"2021-03-11T09:17:11.000Z","size":50,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-19T14:22:04.875Z","etag":null,"topics":["go","log","logger"],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/telanflow.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-12-27T12:23:18.000Z","updated_at":"2021-03-11T09:16:05.000Z","dependencies_parsed_at":"2022-08-27T23:53:31.313Z","dependency_job_id":null,"html_url":"https://github.com/telanflow/logger","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/telanflow%2Flogger","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/telanflow%2Flogger/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/telanflow%2Flogger/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/telanflow%2Flogger/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/telanflow","download_url":"https://codeload.github.com/telanflow/logger/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243297382,"owners_count":20268763,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["go","log","logger"],"created_at":"2024-11-18T13:28:40.426Z","updated_at":"2025-10-16T23:41:38.011Z","avatar_url":"https://github.com/telanflow.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003e\n  \u003cbr\u003eLogger\u003cbr\u003e\n\u003c/h1\u003e\n\n[![GoDoc](https://godoc.org/github.com/telanflow/logger?status.svg)](https://godoc.org/github.com/telanflow/logger)\n\nPackage logger implements a logging infrastructure for Go. Its output format\nis customizable and supports different logger backends like syslog, file and\nmemory. Multiple backends can be utilized with different log levels per backend\nand logger.\n\nFork by [go-logging](https://github.com/op/go-logging)\n\n## Example\n\nLet's have a look at an [example](examples/example.go) which demonstrates most\nof the features found in this library.\n\n[![Example Output](examples/example.png)](examples/example.go)\n\n```go\npackage main\n\nimport (\n\t\"os\"\n\n\t\"github.com/telanflow/logger\"\n)\n\nvar log = logger.MustGetLogger(\"example\")\n\n// Example format string. Everything except the message has a custom color\n// which is dependent on the log level. Many fields have a custom output\n// formatting too, eg. the time returns the hour down to the milli second.\nvar format = logger.MustStringFormatter(\n\t`%{color}%{time:15:04:05.000} %{shortfunc} ▶ %{level:.4s} %{id:03x}%{color:reset} %{message}`,\n)\n\n// Password is just an example type implementing the Redactor interface. Any\n// time this is logged, the Redacted() function will be called.\ntype Password string\n\nfunc (p Password) Redacted() interface{} {\n\treturn logger.Redact(string(p))\n}\n\nfunc main() {\n\t// For demo purposes, create two backend for os.Stderr.\n\tbackend1 := logger.NewLogBackend(os.Stderr, \"\", 0)\n\tbackend2 := logger.NewLogBackend(os.Stderr, \"\", 0)\n\n\t// For messages written to backend2 we want to add some additional\n\t// information to the output, including the used log level and the name of\n\t// the function.\n\tbackend2Formatter := logger.NewBackendFormatter(backend2, format)\n\n\t// Only errors and more severe messages should be sent to backend1\n\tbackend1Leveled := logger.AddModuleLevel(backend1)\n\tbackend1Leveled.SetLevel(logger.ERROR, \"\")\n\n\t// Set the backends to be used.\n\tlogger.SetBackend(backend1Leveled, backend2Formatter)\n\n\tlog.Debugf(\"debug %s\", Password(\"secret\"))\n\tlog.Info(\"info\")\n\tlog.Notice(\"notice\")\n\tlog.Warning(\"warning\")\n\tlog.Error(\"err\")\n\tlog.Critical(\"crit\")\n}\n```\n\n## Installing\n\n### Using *go get*\n\n    $ go get github.com/telanflow/logger\n\nAfter this command *logger* is ready to use. Its source will be in:\n\n    $GOPATH/src/pkg/github.com/telanflow/logger\n\nYou can use `go get -u` to update the package.\n\n## 📄 License\nSource code in `Logger` is available under the [BSD 3 License](/LICENSE).","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftelanflow%2Flogger","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftelanflow%2Flogger","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftelanflow%2Flogger/lists"}