{"id":27620926,"url":"https://github.com/followtheprocess/log","last_synced_at":"2025-04-23T07:33:36.530Z","repository":{"id":285431683,"uuid":"957506088","full_name":"FollowTheProcess/log","owner":"FollowTheProcess","description":"Simple, fast, opinionated logging for command line applications in Go","archived":false,"fork":false,"pushed_at":"2025-04-10T14:08:33.000Z","size":601,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-10T15:49:59.531Z","etag":null,"topics":["go","logging"],"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/FollowTheProcess.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":"2025-03-30T14:44:08.000Z","updated_at":"2025-04-10T14:08:37.000Z","dependencies_parsed_at":"2025-03-31T18:34:48.764Z","dependency_job_id":"3551f1bf-4bd4-4390-bce8-35734f1f77cc","html_url":"https://github.com/FollowTheProcess/log","commit_stats":null,"previous_names":["followtheprocess/log"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FollowTheProcess%2Flog","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FollowTheProcess%2Flog/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FollowTheProcess%2Flog/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FollowTheProcess%2Flog/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/FollowTheProcess","download_url":"https://codeload.github.com/FollowTheProcess/log/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250392712,"owners_count":21423140,"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":["go","logging"],"created_at":"2025-04-23T07:33:35.865Z","updated_at":"2025-04-23T07:33:36.510Z","avatar_url":"https://github.com/FollowTheProcess.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# log\n\n[![License](https://img.shields.io/github/license/FollowTheProcess/log)](https://github.com/FollowTheProcess/log)\n[![Go Reference](https://pkg.go.dev/badge/github.com/FollowTheProcess/log.svg)](https://pkg.go.dev/github.com/FollowTheProcess/log)\n[![Go Report Card](https://goreportcard.com/badge/github.com/FollowTheProcess/log)](https://goreportcard.com/report/github.com/FollowTheProcess/log)\n[![GitHub](https://img.shields.io/github/v/release/FollowTheProcess/log?logo=github\u0026sort=semver)](https://github.com/FollowTheProcess/log)\n[![CI](https://github.com/FollowTheProcess/log/workflows/CI/badge.svg)](https://github.com/FollowTheProcess/log/actions?query=workflow%3ACI)\n[![codecov](https://codecov.io/gh/FollowTheProcess/log/branch/main/graph/badge.svg)](https://codecov.io/gh/FollowTheProcess/log)\n\nSimple, fast, opinionated logging for command line applications 🪵\n\n\u003cp align=\"center\"\u003e\n\u003cimg src=\"https://github.com/FollowTheProcess/log/raw/main/docs/img/demo.gif\" alt=\"demo\"\u003e\n\u003c/p\u003e\n\n## Project Description\n\n`log` is a tiny and incredibly simple logging library designed to output nicely presented, human readable, levelled log messages. Ideal for command line applications ✨\n\nThere are many great logging libraries for Go out there, but so many of them are IMO too flexible and too complicated. I wanted a small, minimal dependency, opinionated logger I could\nuse everywhere across all my Go projects (which are mostly command line applications). So I made one 🚀\n\n## Installation\n\n```shell\ngo get github.com/FollowTheProcess/log@latest\n```\n\n## Quickstart\n\n```go\npackage main\n\nimport (\n    \"fmt\"\n    \"os\"\n\n    \"github.com/FollowTheProcess/log\"\n)\n\nfunc main() {\n    logger := log.New(os.Stderr)\n\n    logger.Debug(\"Debug me\") // By default this one won't show up, default log level is INFO\n    logger.Info(\"Some information here\", \"really\", true)\n    logger.Warn(\"Uh oh!\")\n    logger.Error(\"Goodbye\")\n}\n```\n\n## Usage Guide\n\nMake a new logger\n\n```go\nlogger := log.New(os.Stderr)\n```\n\n### Levels\n\n`log` provides a levelled logger with the normal levels you'd expect:\n\n```go\nlog.LevelDebug\nlog.LevelInfo\nlog.LevelWarn\nlog.LevelError\n```\n\nYou write log lines at these levels with the corresponding methods on the `Logger`:\n\n```go\nlogger.Debug(\"...\") // log.LevelDebug\nlogger.Info(\"...\")  // log.LevelInfo\nlogger.Warn(\"...\")  // log.LevelWarn\nlogger.Error(\"...\") // log.LevelError\n```\n\nAnd you can configure a `Logger` to display logs at or higher than a particular level with the `WithLevel` option...\n\n```go\nlogger := log.New(os.Stderr, log.WithLevel(log.LevelDebug))\n```\n\n### Key Value Pairs\n\n`log` provides \"semi structured\" logs in that the message is free form text but you can attach arbitrary key value pairs to any of the log methods\n\n```go\nlogger.Info(\"Doing something\", \"cache\", true, \"duration\", 30 * time.Second, \"number\", 42)\n```\n\nYou can also create a \"sub logger\" with persistent key value pairs applied to every message\n\n```go\nsub := logger.With(\"sub\", true)\n\nsub.Info(\"Hello from the sub logger\", \"subkey\", \"yes\") // They can have their own per-method keys too!\n```\n\n\u003cp align=\"center\"\u003e\n\u003cimg src=\"https://github.com/FollowTheProcess/log/raw/main/docs/img/keys.gif\" alt=\"demo\"\u003e\n\u003c/p\u003e\n\n### Prefixes\n\n`log` lets you apply a \"prefix\" to your logger, either as an option to `log.New` or by creating a \"sub logger\" with that prefix!\n\n```go\nlogger := log.New(os.Stderr, log.Prefix(\"http\"))\n```\n\nOr...\n\n```go\nlogger := log.New(os.Stderr)\nprefixed := logger.Prefixed(\"http\")\n```\n\n\u003cp align=\"center\"\u003e\n\u003cimg src=\"https://github.com/FollowTheProcess/log/raw/main/docs/img/prefix.gif\" alt=\"demo\"\u003e\n\u003c/p\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffollowtheprocess%2Flog","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffollowtheprocess%2Flog","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffollowtheprocess%2Flog/lists"}