{"id":20188834,"url":"https://github.com/mateenbagheri/hermes","last_synced_at":"2025-09-17T19:10:14.033Z","repository":{"id":153280187,"uuid":"628537589","full_name":"mateenbagheri/hermes","owner":"mateenbagheri","description":"Hermes is a logger wrapper","archived":false,"fork":false,"pushed_at":"2023-04-20T10:13:52.000Z","size":48,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-03T07:14:07.211Z","etag":null,"topics":["go","golang","influxdb","logging","zerolog"],"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/mateenbagheri.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":"2023-04-16T09:02:55.000Z","updated_at":"2023-04-16T13:31:15.000Z","dependencies_parsed_at":null,"dependency_job_id":"6650a913-27d4-419f-884a-a4be9bbed464","html_url":"https://github.com/mateenbagheri/hermes","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/mateenbagheri/hermes","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mateenbagheri%2Fhermes","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mateenbagheri%2Fhermes/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mateenbagheri%2Fhermes/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mateenbagheri%2Fhermes/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mateenbagheri","download_url":"https://codeload.github.com/mateenbagheri/hermes/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mateenbagheri%2Fhermes/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":275648643,"owners_count":25503201,"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","status":"online","status_checked_at":"2025-09-17T02:00:09.119Z","response_time":84,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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","golang","influxdb","logging","zerolog"],"created_at":"2024-11-14T03:32:04.924Z","updated_at":"2025-09-17T19:10:13.965Z","avatar_url":"https://github.com/mateenbagheri.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Hermes\n\u003e\n\u003eHermes was the messenger of the gods in Greek mythology, known for his cunning, speed, and versatility. He was the son of Zeus and the nymph Maia, and he was born in a cave on Mount Cyllene in Arcadia.\n\nThis repository provides a logger service that implements the ZeroLog repository and supports three types of logger writers:\n\n* DB writer: logs messages to a database (there is an influxDB implementation integrated too)\n* CLI writer: logs messages to the console (stdout)\n* File writer: logs messages to a file\n\n## Installation\n\nTo use the logger service, you'll need to install the package using Go modules:\n\n```\ngo get github.com/mateenbagheri/hermes\n```\n\n## Usage\n\nTo use the logger service, you'll first need to create a logger instance using one of the available writer types:\n\n```go\nimport \"github.com/mateenbagheri/hermes\"\nlogger := hermes.New(hermes.ZeroLoggerType).\n    WithLevel(hermes.DebugLevel).\n    WithServiceName(\"test\").\n    WithWriters(\n        // Create a new logger instance with a CLI writer\n        hermes.ConsoleWriterType,\n        // Create a new logger instance with a file writer\n        hermes.FileWriterType,\n    ).\n    Build().\n    WithScope(\"main\")\n\nlogger.Debug(\"this is a test\")\n\n```\n\nOnce you have a logger instance, you can use it to log messages at different levels:\n\n```go\nlogger.Trace(\"This is a trace message\")\nlogger.Debug(\"This is a debug message\")\nlogger.Info(\"This is an info message\")\nlogger.Warn(\"This is a warning message\")\nlogger.Error(\"This is an error message\")\nlogger.Fatal(\"This is a fatal message\")\nlogger.Panic(\"This is a panic message\")\n```\n\nYou can also log messages with additional key-value pairs:\n\n```go\nlogger.Tracev(\"This is a trace message with additional data\", \"key1\", \"value1\", \"key2\", \"value2\")\n```\n\n## Configuration\n\nIn case you want to use the InfluxDB as the database writer, you will need to add `.WithInfluxConfig()` to the `.New()` method. for configuring influx, you will need the following configs:\n```go\nimport \"github.com/mateenbagheri/hermes\"\nlogger := hermes.New(hermes.ZeroLoggerType).\n    WithInfluxConfig(\n       os.Getenv(\"INFLUX_ADDRESS\"),\n       os.Getenv(\"INFLUX_TOKEN\"),\n       os.Getenv(\"INFLUX_ORGANIZATION\"),\n       os.Getenv(\"INFLUX_BUCKET\"),\n    ).\n    WithLevel(hermes.DebugLevel).\n    WithServiceName(\"test\").\n    WithWriters(\n        // Create a new logger instance with a CLI writer\n        hermes.ConsoleWriterType,\n        // Create a new logger instance with a file writer\n        hermes.FileWriterType,\n        // Create a new logger instance with an InfluxDB writer\n        hermes.DatabaseWriterType,\n    ).\n    Build().\n    WithScope(\"main\")\n\nlogger.Debug(\"this is a test\")\n```\n\n## Contributing\n\nThank you for considering contributing to Hermes! Please follow these guidelines to ensure your contribution is properly considered:\n\n1. Fork the repository and create your branch from main.\n2. Make your changes, and add new tests as appropriate.\n3. Run go test to make sure all tests pass.\n4. Format your code with gofmt -s.\n5. Ensure your code passes golint.\n6. Commit your changes and push your branch to your forked repository.\nCreate a pull request to the main Hermes repository.\n\nIf you would like to report a bug or suggest a new feature, please feel free to open a GitHub issue in the Hermes repository. We welcome all feedback and suggestions!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmateenbagheri%2Fhermes","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmateenbagheri%2Fhermes","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmateenbagheri%2Fhermes/lists"}