{"id":16617124,"url":"https://github.com/molovo/lumberjack","last_synced_at":"2025-03-21T14:31:28.627Z","repository":{"id":153210990,"uuid":"67159962","full_name":"molovo/lumberjack","owner":"molovo","description":"Lumberjack is a logging interface for shell scripts","archived":false,"fork":false,"pushed_at":"2016-09-14T20:34:54.000Z","size":10,"stargazers_count":43,"open_issues_count":1,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-18T02:12:02.023Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Shell","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/molovo.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}},"created_at":"2016-09-01T19:25:45.000Z","updated_at":"2024-09-16T05:17:09.000Z","dependencies_parsed_at":"2024-01-03T04:12:49.160Z","dependency_job_id":"709c3562-3575-46f6-a0f5-4a40e0b74c44","html_url":"https://github.com/molovo/lumberjack","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/molovo%2Flumberjack","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/molovo%2Flumberjack/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/molovo%2Flumberjack/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/molovo%2Flumberjack/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/molovo","download_url":"https://codeload.github.com/molovo/lumberjack/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244815198,"owners_count":20514912,"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":[],"created_at":"2024-10-12T02:15:25.515Z","updated_at":"2025-03-21T14:31:28.255Z","avatar_url":"https://github.com/molovo.png","language":"Shell","readme":"# Lumberjack\n\nLumberjack is a logging interface for shell scripts.\n\n## About\n\nLumberjack handles your logs for you. When you set a logfile and log level, it is linked to the process ID of the script in which it is run, so that further calls need only contain the message to append to the logfile.\n\n## Installation\n\n### Requirements\n\nAlthough lumberjack can be used within any script, ZSH 5+ must be installed and in your $PATH in order to run it.\n\n### [Zulu](https://github.com/zulu-zsh/zulu)\n\n```sh\nzulu install lumberjack\n```\n\n### Manual\n\nSimply move the `lj` executable to somewhere in your $PATH.\n\n```sh\ngit clone https://github.com/molovo/lumberjack\nmv lumberjack/lj /usr/local/bin\n```\n\n## Usage\n\nLumberjack should be called a first time to set the log file and level.\n\n```sh\nlj --file /usr/local/var/log/myawesomescript.log --level critical\n```\n\nOnce done, further calls need only contain the level at which that log applies, and the message.\n\n```sh\nlj critical ‘Something went wrong’\n```\n\nThe level is any one of `emergency`, `alert`, `critical`, `error`, `warning`, `notice`, `info` or `debug`. If the level is not set, the default is `notice`. Likewise, when logging you can omit the first parameter, and a level of `notice` is assumed.\n\n```sh\nlj 'This is a notice'\n```\n\nIf a message is logged at a level lower than that which is set, it is gracefully ignored. This allows you to dynamically set the log level based on parameters passed to your script.\n\n```sh\n#!/usr/bin/env zsh\n\n# Parse CLI options\nzparseopts -D v=verbose -verbose=verbose\n\n# Set the log level\nlocal level=critical\n[[ $verbose ]] \u0026\u0026 level=notice\n\n# Initialise lumberjack\nlj --file ~/log --level $level\n\nlj 'This is a notice'\n```\n\nIn the above example, running `script.zsh` would result in nothing being output to the log. Running `script.zsh --verbose` would increase the log level, allowing the notice to be appended to the log file.\n\n## TODO\n\n* Allow log format to be modified\n* Add additional drivers for send logs to services like [Sentry](http://sentry.io) etc.\n\n## License\n\nCopyright (c) 2016 James Dinsdale \u003chi@molovo.co\u003e (molovo.co)\n\nLumberjack is licensed under The MIT License (MIT)\n\n## Team\n\n* [James Dinsdale](http://molovo.co)\n","funding_links":[],"categories":["Plugins","Shell Script Development"],"sub_categories":["ZSH on Windows","Zinit (née zplugin)","Directory Navigation"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmolovo%2Flumberjack","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmolovo%2Flumberjack","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmolovo%2Flumberjack/lists"}