{"id":17617501,"url":"https://github.com/gowizzard/proto","last_synced_at":"2025-03-30T00:41:27.131Z","repository":{"id":59044737,"uuid":"528859214","full_name":"gowizzard/proto","owner":"gowizzard","description":"An library to log from golang to file or command line.","archived":false,"fork":false,"pushed_at":"2022-09-27T09:54:38.000Z","size":66,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-05T02:43:32.335Z","etag":null,"topics":["command-line","filesystem","go","golang","golang-library","logging","logs","protocol"],"latest_commit_sha":null,"homepage":"","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/gowizzard.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-08-25T13:17:35.000Z","updated_at":"2022-08-27T18:09:12.000Z","dependencies_parsed_at":"2023-01-19T04:02:16.348Z","dependency_job_id":null,"html_url":"https://github.com/gowizzard/proto","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gowizzard%2Fproto","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gowizzard%2Fproto/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gowizzard%2Fproto/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gowizzard%2Fproto/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gowizzard","download_url":"https://codeload.github.com/gowizzard/proto/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246262492,"owners_count":20749170,"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":["command-line","filesystem","go","golang","golang-library","logging","logs","protocol"],"created_at":"2024-10-22T19:14:12.936Z","updated_at":"2025-03-30T00:41:27.101Z","avatar_url":"https://github.com/gowizzard.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# proto\n\n[![GitHub go.mod Go version of a Go module](https://img.shields.io/github/go-mod/go-version/gowizzard/proto.svg)](https://golang.org/) [![Go](https://github.com/gowizzard/proto/actions/workflows/go.yml/badge.svg)](https://github.com/gowizzard/proto/actions/workflows/go.yml) [![CodeQL](https://github.com/gowizzard/proto/actions/workflows/codeql.yml/badge.svg)](https://github.com/gowizzard/proto/actions/workflows/codeql.yml) [![CompVer](https://github.com/gowizzard/proto/actions/workflows/compver.yml/badge.svg)](https://github.com/gowizzard/proto/actions/workflows/compver.yml) [![Go Report Card](https://goreportcard.com/badge/github.com/gowizzard/proto)](https://goreportcard.com/report/github.com/gowizzard/proto) [![Go Reference](https://pkg.go.dev/badge/github.com/gowizzard/proto.svg)](https://pkg.go.dev/github.com/gowizzard/proto) [![GitHub issues](https://img.shields.io/github/issues/gowizzard/proto)](https://github.com/gowizzard/proto/issues) [![GitHub forks](https://img.shields.io/github/forks/gowizzard/proto)](https://github.com/gowizzard/proto/network) [![GitHub stars](https://img.shields.io/github/stars/gowizzard/proto)](https://github.com/gowizzard/proto/stargazers) [![GitHub license](https://img.shields.io/github/license/gowizzard/proto)](https://github.com/gowizzard/proto/blob/master/LICENSE)\n\nThe name proto comes from the German word protokollieren `/protokolliéren/`. Accordingly, the whole thing has nothing to do with creating prototypes, but only logging. Since of course also with pleasure for prototypes.\n\n## Install\n\n```console\ngo get github.com/gowizzard/proto\n```\n\n## How to use?\n\nThe library should help you to make logging easier for the command line as well as file based. For example, you can add the file information to your error message, so that we can enter the exact file and line of the error. You can also add more attributes via a map.\n\nThe functionality is currently being expanded, so check back from time to time, or create an [issue](https://github.com/gowizzard/proto/issues) if desired.\n\nHere you can find an example how to use the library:\n\n```go\nc := proto.Config{\n    Information:    true, \n    Convert: \u0026map[string]string{\n        \"error\": \"purple\",\n    }, \n    Monthly:\t    false,\n    CommandLine:    false,\n    File:           true,\n    Path:           \"/var/log/proto\",\n} \n\nerr := c.Log(\"error\", \"this is the error message\", map[string]any{})\nif err != nil {\n    log.Fatal(err)\n}\n```\n\nIn this example, we generate the configuration we need as it stores general information. Here you can store for example the path to the folder of the log files, or also whether a log in the command line or only file-based. Both and is also possible.\n\nIf you want to log file based, then we create in a specified path a folder per month and for each day a separate log file in this folder, so you always get the best overview of your logs.\n\nHere you can find a sample log:\n\n```console\nINFO[2022-08-26T11:51:30]  This is a informational message.\tFILE=log_test.go:65\n```\n\nWe color the log kinds so that you can differentiate them immediately, so `error` is shown as red and `warning` as yellow. Everything else is displayed in cyan.\n\nIf you want to map to other kinds of colors, you can store them in the convert map. Please note that the default values will be overwritten. These look like this:\n\n```go\nmap[string]string{\n    \"default\": \"cyan\",\n    \"error\":   \"red\",\n    \"warning\": \"yellow\",\n}\n```\n\nYou can use the following colors for your mapping: `red`, `green`, `yellow`, `blue`, `purple` \u0026 `cyan`.\n\n## Special thanks\n\nThanks to [JetBrains](https://github.com/JetBrains) for supporting me with this and other [open source projects](https://www.jetbrains.com/community/opensource/#support).","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgowizzard%2Fproto","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgowizzard%2Fproto","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgowizzard%2Fproto/lists"}