{"id":16516219,"url":"https://github.com/aphistic/gomol-writer","last_synced_at":"2025-03-02T18:16:52.979Z","repository":{"id":57602652,"uuid":"63107459","full_name":"aphistic/gomol-writer","owner":"aphistic","description":"A gomol logger to write to any io.Writer","archived":false,"fork":false,"pushed_at":"2017-05-16T04:22:26.000Z","size":6,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-13T05:22:02.346Z","etag":null,"topics":["gomol"],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/aphistic.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":"2016-07-11T22:44:34.000Z","updated_at":"2017-05-16T04:22:27.000Z","dependencies_parsed_at":"2022-09-26T20:01:03.404Z","dependency_job_id":null,"html_url":"https://github.com/aphistic/gomol-writer","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aphistic%2Fgomol-writer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aphistic%2Fgomol-writer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aphistic%2Fgomol-writer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aphistic%2Fgomol-writer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aphistic","download_url":"https://codeload.github.com/aphistic/gomol-writer/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241549117,"owners_count":19980476,"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":["gomol"],"created_at":"2024-10-11T16:20:04.920Z","updated_at":"2025-03-02T18:16:52.947Z","avatar_url":"https://github.com/aphistic.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"gomol-writer\n============\n\n[![GoDoc](https://godoc.org/github.com/aphistic/gomol-writer?status.svg)](https://godoc.org/github.com/aphistic/gomol-writer)\n[![Build Status](https://img.shields.io/travis/aphistic/gomol-writer.svg)](https://travis-ci.org/aphistic/gomol-writer)\n[![Code Coverage](https://img.shields.io/codecov/c/github/aphistic/gomol-writer.svg)](http://codecov.io/github/aphistic/gomol-writer?branch=master)\n\ngomol-writer is a logger for [gomol](https://github.com/aphistic/gomol) to support logging to an `io.Writer`.\n\nInstallation\n============\n\nThe recommended way to install is via http://gopkg.in\n\n    go get gopkg.in/aphistic/gomol-writer.v0\n    ...\n    import \"gopkg.in/aphistic/gomol-writer.v0\"\n\ngomol-writer can also be installed the standard way as well\n\n    go get github.com/aphistic/gomol-writer\n    ...\n    import \"github.com/aphistic/gomol-writer\"\n\nExamples\n========\n\nFor brevity a lot of error checking has been omitted, be sure you do your checks!\n\nThis is a super basic example of adding an io.Writer logger to gomol and then logging a few messages:\n\n```go\npackage main\n\nimport (\n\t\"os\"\n\t\"github.com/aphistic/gomol\"\n\tgw \"github.com/aphistic/gomol-writer\"\n)\n\nfunc main() {\n\t// Add an io.Writer logger\n\twriterCfg := gw.NewWriterLoggerConfig()\n\twriterLogger, _ := gw.NewWriterLogger(os.Stdout, writerCfg)\n\tgomol.AddLogger(writerLogger)\n\n\t// Set some global attrs that will be added to all\n\t// messages automatically\n\tgomol.SetAttr(\"facility\", \"gomol.example\")\n\tgomol.SetAttr(\"another_attr\", 1234)\n\n\t// Initialize the loggers\n\tgomol.InitLoggers()\n\tdefer gomol.ShutdownLoggers()\n\n\t// Log some debug messages with message-level attrs\n\t// that will be sent only with that message\n\tfor idx := 1; idx \u003c= 10; idx++ {\n\t\tgomol.Dbgm(\n\t\t\tgomol.NewAttrs().\n\t\t\t\tSetAttr(\"msg_attr1\", 4321),\n\t\t\t\"Test message %v\", idx)\n\t}\n}\n\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faphistic%2Fgomol-writer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faphistic%2Fgomol-writer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faphistic%2Fgomol-writer/lists"}