{"id":15608883,"url":"https://github.com/borislavv/go-logger","last_synced_at":"2025-03-29T14:25:57.736Z","repository":{"id":257802317,"uuid":"863457102","full_name":"Borislavv/go-logger","owner":"Borislavv","description":"Simple wrapper over the Logrus logger.","archived":false,"fork":false,"pushed_at":"2024-12-11T11:19:58.000Z","size":26,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-04T15:27:23.037Z","etag":null,"topics":["golang","library","logrus","wrapper"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Borislavv.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-09-26T10:25:29.000Z","updated_at":"2024-12-11T11:19:30.000Z","dependencies_parsed_at":"2024-12-09T20:43:47.807Z","dependency_job_id":"1af4544e-fe12-4fbf-98bf-c63d2f04ba22","html_url":"https://github.com/Borislavv/go-logger","commit_stats":null,"previous_names":["borislavv/go-logger"],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Borislavv%2Fgo-logger","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Borislavv%2Fgo-logger/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Borislavv%2Fgo-logger/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Borislavv%2Fgo-logger/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Borislavv","download_url":"https://codeload.github.com/Borislavv/go-logger/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246195057,"owners_count":20738795,"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":["golang","library","logrus","wrapper"],"created_at":"2024-10-03T05:40:23.896Z","updated_at":"2025-03-29T14:25:57.718Z","avatar_url":"https://github.com/Borislavv.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Logrus logger wrapper.\n\n### ENVs: \n1. **LOGGER_LEVEL** (values: info, debug, warning, error, fatal, panic)\n2. **LOGGER_OUTPUT** (values: /dev/null/, stdout, stderr, filename (example: /var/log/dev.log))\n3. **LOGGER_FORMAT** (values: text, json)\n4. **LOGGER_LOGS_DIR** (values: any dir from root project dir., for example: var/log)\n5. **LOGGER_CONTEXT_EXTRA_FIELD** (any values which will extracts from context.Context, for example: jobID, taskID)\n\n### Usage:\n    cfg, err := loggerconfig.Load()\n    if err != nil {\n    \tpanic(err)\n    }\n\n    output, cancelOutput, err := logger.NewOutput(cfg)\n    if err != nil {\n        panic(err)\n    }\n    defer cancelOutput()\n\n\tlgr, lgrCancel, err := logger.NewLogrus(cfg, output)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer lgrCancel()\n\n\tlgr.InfoMsg(ctx, \"hello world\", logger.Fields{\n        \"error\": \"no-errors\",\n        \"any\": \"additional fields\", \n    })\n\n### Note: \n\nAn **output, cancelOutput, err := logger.NewOutput()** must be called just once per unique output, or you will see an error  \nof closing already closed file while canceling the output. This happens due to two outputs refers to the same file pointer.\n\n**Example:**\n\n    output1, cancelOutput1, _   := logger.NewOutput(\"stdout\")\n    output2, cancelOutput2, _   := logger.NewOutput(\"stdout\")\n    cancelOutput1() // ok\n    cancelOutput2() // error: closing file already closed\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fborislavv%2Fgo-logger","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fborislavv%2Fgo-logger","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fborislavv%2Fgo-logger/lists"}