{"id":16207912,"url":"https://github.com/applejag/flog","last_synced_at":"2025-03-19T08:30:39.819Z","repository":{"id":46210760,"uuid":"331334192","full_name":"applejag/flog","owner":"applejag","description":"Filter logs on their serverity (even multiline logs), with automatic detection of log formats","archived":true,"fork":false,"pushed_at":"2022-07-20T11:52:39.000Z","size":179,"stargazers_count":1,"open_issues_count":3,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-16T01:00:18.642Z","etag":null,"topics":["cli","command-line","go","golang","logging"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/applejag.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2021-01-20T14:38:41.000Z","updated_at":"2024-10-27T23:43:09.000Z","dependencies_parsed_at":"2022-07-23T10:34:28.640Z","dependency_job_id":null,"html_url":"https://github.com/applejag/flog","commit_stats":null,"previous_names":["applejag/flog","jillejr/flog"],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/applejag%2Fflog","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/applejag%2Fflog/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/applejag%2Fflog/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/applejag%2Fflog/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/applejag","download_url":"https://codeload.github.com/applejag/flog/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244389649,"owners_count":20444978,"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":["cli","command-line","go","golang","logging"],"created_at":"2024-10-10T10:14:46.632Z","updated_at":"2025-03-19T08:30:38.624Z","avatar_url":"https://github.com/applejag.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003c!--\nSPDX-FileCopyrightText: 2021 Kalle Fagerberg\n\nSPDX-License-Identifier: CC0-1.0\n--\u003e\n\n# flog\n\n[![Codacy Badge](https://api.codacy.com/project/badge/Grade/520a6bd7df4144938eec6295b7a98561)](https://app.codacy.com/gh/jilleJr/flog?utm_source=github.com\u0026utm_medium=referral\u0026utm_content=jilleJr/flog\u0026utm_campaign=Badge_Grade_Settings)\n[![REUSE status](https://api.reuse.software/badge/github.com/jilleJr/flog)](https://api.reuse.software/info/github.com/jilleJr/flog)\n\nFilter logs on their serverity, with automatic detection of log formats\n\n## Sample usage\n\n### Sample Go app using [sirupsen/logrus](https://github.com/sirupsen/logrus)\n\n```console\n$ go run main.go\nTRAC[0000] A walrus appears                              animal=walrus\nDEBU[0000] A walrus appears                              animal=walrus\nINFO[0000] A walrus appears                              animal=walrus\nWARN[0000] A walrus appears                              animal=walrus\nERRO[0000] A walrus appears                              animal=walrus\nFATA[0000] A walrus appears                              animal=walrus\n\n$ go run main.go | flog -s warn\nflog: Omitted 1 Trace, 1 Debug, 1 Information.\nWARN[0000] A walrus appears                              animal=walrus\nERRO[0000] A walrus appears                              animal=walrus\nFATA[0000] A walrus appears                              animal=walrus\n```\n\n### Sample .NET app using [Microsoft.Extensions.Logging.Console](https://docs.microsoft.com/en-us/dotnet/core/extensions/console-log-formatter)\n\nYes, this includes multiline logs, such as those pesky .NET logs:\n\n```console\n$ dotnet run\ntrac: Program[0]\n      Sample log\ndbug: Program[0]\n      Sample log\ninfo: Program[0]\n      Sample log\nwarn: Program[0]\n      Sample log\nfail: Program[0]\n      Sample log\n\n$ dotnet run | flog -s warn\nflog: Omitted 1 Trace, 1 Debug, 1 Information.\nwarn: Program[0]\n      Sample log\nfail: Program[0]\n      Sample log\n```\n\n## Command-line interface\n\n```console\n$ flog --help\nUsage: flog [\u003cpaths\u003e ...]\n\nUse flog to filter logs on their serverity (even multiline logs), with automatic detection of log\nformats.\n\nflog Copyright (C) 2021 Kalle Jillheden\n\n    License GPLv3+: GNU GPL version 3 or later \u003chttps://gnu.org/licenses/gpl.html\u003e\n    This program comes with ABSOLUTELY NO WARRANTY; for details run 'flog --license-w'.\n    This is free software, and you are welcome to redistribute it\n    under certain conditions; run 'flog --license-c' for details.\n\nArguments:\n  [\u003cpaths\u003e ...]    File(s) to read logs from. Uses STDIN if unspecified\n\nFlags:\n  -h, --help                     Show context-sensitive help.\n  -s, --min=info                 Omit logs below specified severity (exclusive)\n  -S, --max=none                 Omit logs above specified severity (exclusive)\n  -t, --since=STRING             Omit logs timestamped before a specific time (or relative time period\n                                 ago) [Not yet implemented]\n  -t, --before=STRING            Omit logs timestamped after a specific time (or relative time period\n                                 ago) [Not yet implemented]\n  -e, --exclude=EXCLUDE,...      Omit logs of specified severity (can be specified multiple times)\n  -i, --include=INCLUDE,...      Omit logs of severity not specified with this flag (can be specified\n                                 multiple times)\n  -q, --quiet                    Omit the 'omitted logs' messages. Shorthand for --verbose=0.\n  -v, --verbose=1                Enable verbose output (can be specified up to 2 times, ex: --verbose=2\n                                 or -vv)\n      --version                  Show the version of the program and then exit.\n      --completions-install      Install shell completions\n      --completions-uninstall    Uninstall shell completions\n      --license-c                Show the programs license conditions and then exit. (Warn: a lot of\n                                 text)\n      --license-w                Show the programs warranty and then exit.\n\nSeverities:\n  Undefined      0, n, nil, null, none, unde, undefined\n  Unknown        1, ?, u, ukwn, unkn, unknown\n  Trace          2, t, tra, trac, trce, trace\n  Debug          3, d, deb, debu, debg, dbug, debug\n  Information    4, i, inf, info, information\n  Warning        5, w, wrn, warn, warning\n  Error          6, e, err, erro, errr, error\n  Critical       7, c, crt, crit, critical\n  Fatal          8, f, fata, fatl, fatal\n  Panic          9, p, pan, pnc, pani, panic\n```\n\n## Installation\n\n1. Head over to the latest release\n   \u003chttps://github.com/jilleJr/flog/releases/latest\u003e\n\n2. Down in the \"Assets\", find the one that matches your OS and architecture,\n   and download it.\n\n3. Save it to a location you have added to your `$PATH`, for example\n   `~/.local/bin`\n\n4. Make sure to just rename it to `flog` (or `flog.exe` for Windows users).\n\n5. Done!\n\n\nIf your OS or architecture is missing from the list, then\n[create an issue on it](https://github.com/jilleJr/flog/issues/new/choose) and\nI'll make sure to build it to your architecture when I release a new build.\n\n## Main use case\n\nSearching through logs in Kubernetes. For example, to find any error logs in\nKubernetes logs you'd usually have to use `grep` with some extreamly high\ncontext so that you get a glimpse of what the error was about.\n\nWith `flog` you can just run:\n\n```console\n$ kubectl logs name-of-my-pod | flog -s err\n```\n\nAnd there you have it.\n\n## Building from source\n\n1. Install Go\n\n2. Run the following (outside of a Go project) to build the latest release\n\n   \u003e The -u flag updates the package if you've already the package installed.\n\n   ```console\n   $ go get -u github.com/jilleJr/flog\n   ```\n\n   Or if you want to build the latest unreleased version from the `main` branch\n   then clone the repo and run `go install` or `make install`:\n   (No `sudo` is required)\n   \n   ```console\n   $ git clone https://github.com/jilleJr/flog\n   $ cd flog\n   $ make install\n   ```\n\n## Releasing\n\n1. Install Go \u0026 Make\n\n2. Run the following to generate the executables into the `bin/` directory\n\n   ```console\n   $ make release\n   ```\n\n3. Update the date in `CHANGELOG.md`, for example changing\n\n   ```diff\n   diff --git a/CHANGELOG.md b/CHANGELOG.md\n   index 9622e17..18ce396 100644\n   --- a/CHANGELOG.md\n   +++ b/CHANGELOG.md\n   @@ -6,7 +6,7 @@ This project tries to use [SemVer 2.0.0](https://semver.org)\n        Remember to update the version.go file whenever you add a new version.\n    --\u003e\n   \n   -## v0.3.0 (WIP)\n   +## v0.3.0 (2020-02-13)\n   \n    - Added debug logging, enabled by specifying `-vv` or `--verbose=2`. (#13)\n   \n   ```\n\n4. Create a Git tag\n\n   ```console\n   $ git tag v0.3.0 -m \"flog v0.3.0\"\n   \n   $ git push --follow-tags\n   ```\n\n5. Create a GitHub release of the Git tag and upload the binaries to that release\n\n## License\n\nWritten and maintained by [@jilleJr](https://github.com/jilleJr).\nLicensed under the GNU GPL 3.0 or later, or the CC0 1.0, depending on the file.\n\nThis repository is [REUSE](https://reuse.software/) compliant.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fapplejag%2Fflog","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fapplejag%2Fflog","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fapplejag%2Fflog/lists"}