{"id":15647581,"url":"https://github.com/drdaeman/viper-mate","last_synced_at":"2025-03-29T23:25:28.767Z","repository":{"id":139587654,"uuid":"113097938","full_name":"drdaeman/viper-mate","owner":"drdaeman","description":"Viper configuration provider for Logrus Mate","archived":false,"fork":false,"pushed_at":"2018-04-28T14:54:36.000Z","size":8,"stargazers_count":0,"open_issues_count":1,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-05T00:46:34.843Z","etag":null,"topics":["configuration","go","golang","golang-library","logging","logrus","logrus-helper","spf13-viper"],"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/drdaeman.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":"2017-12-04T21:37:33.000Z","updated_at":"2019-03-13T03:44:39.000Z","dependencies_parsed_at":null,"dependency_job_id":"8f4285a0-92a9-4d65-8207-0656fdd3cff1","html_url":"https://github.com/drdaeman/viper-mate","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drdaeman%2Fviper-mate","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drdaeman%2Fviper-mate/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drdaeman%2Fviper-mate/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drdaeman%2Fviper-mate/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/drdaeman","download_url":"https://codeload.github.com/drdaeman/viper-mate/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246258097,"owners_count":20748510,"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":["configuration","go","golang","golang-library","logging","logrus","logrus-helper","spf13-viper"],"created_at":"2024-10-03T12:19:55.559Z","updated_at":"2025-03-29T23:25:28.746Z","avatar_url":"https://github.com/drdaeman.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"Viper configuration provider for Logrus Mate\n============================================\n\nThis tiny project is a way to configure Logrus Mate using Viper\nas the configuration source. It is meant to be used with the currently\nunreleased version of Logrus Mate (`v1.0.0` doesn't have the configuration\nproviders, only `master` branch does).\n\nAs Viper is very different to other configuration options, there is\nno way to mix it with e.g. HOCON. Basically, the assumption is that\nyour project uses Viper and you don't want any other configuration\nsystem just for logging. If so, this library may come handy.\n\nHere's a code snippet with usage example:\n\n    loggingConfig := viper.Sub(\"logging\")\n\tif loggingConfig != nil {\n\t\tmate, err := vipermate.NewMate(loggingConfig)\n\t\tif err != nil {\n\t\t\tlogrus.WithError(err).Panic(\"Failed to process configuration\")\n\t\t}\n\t\tif err = mate.Hijack(logrus.StandardLogger(), \"main\"); err != nil {\n\t\t\tlogrus.WithError(err).Panic(\"Failed to configure main logger\")\n\t\t}\n\t}\n\nThen, an example config (I use YAML, YMMV) could look like, e.g.:\n\n    logging:\n      main:\n        out:\n          name: stdout\n          options: {}\n        level: debug\n        formatter:\n          name: text\n          options:\n            force-colors: true\n            timestamp-format: \"2006-01-02T15:04:05Z07:00\"\n            disable-timestamp: false\n            full-timestamp: true\n        hooks:\n          # Let's say we want to set up an ELK hook\n          logstash:\n            protocol: tcp\n            address: \"elk.example.org:5959\"\n            name: \"myapp\"\n\nCheck out the source code for more details and information\nabout the limitations. In particular, non-string slice functions\nare not implemented because Viper doesn't have anything like that.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdrdaeman%2Fviper-mate","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdrdaeman%2Fviper-mate","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdrdaeman%2Fviper-mate/lists"}