{"id":13696103,"url":"https://github.com/nk412/tinylogger","last_synced_at":"2025-07-23T22:42:22.008Z","repository":{"id":52874104,"uuid":"109873807","full_name":"nk412/tinylogger","owner":"nk412","description":"Lightweight logging framework for bash","archived":false,"fork":false,"pushed_at":"2021-04-16T13:43:30.000Z","size":7,"stargazers_count":39,"open_issues_count":2,"forks_count":9,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-12-08T00:58:19.218Z","etag":null,"topics":["bash","logging","logging-library","shell-script"],"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/nk412.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}},"created_at":"2017-11-07T18:21:30.000Z","updated_at":"2023-06-17T21:46:57.000Z","dependencies_parsed_at":"2022-08-23T03:40:18.234Z","dependency_job_id":null,"html_url":"https://github.com/nk412/tinylogger","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nk412%2Ftinylogger","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nk412%2Ftinylogger/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nk412%2Ftinylogger/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nk412%2Ftinylogger/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nk412","download_url":"https://codeload.github.com/nk412/tinylogger/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252203160,"owners_count":21710899,"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":["bash","logging","logging-library","shell-script"],"created_at":"2024-08-02T18:00:36.313Z","updated_at":"2025-05-03T14:30:55.571Z","avatar_url":"https://github.com/nk412.png","language":"Shell","funding_links":[],"categories":["\u003ca name=\"scripting\"\u003e\u003c/a\u003escripting"],"sub_categories":[],"readme":"# tinylogger\n\nAn *extremely* lightweight logging framework for BASH scripts.\nDeveloped and tested on MacOS. This should work on any BASH platform.\n\n## Log levels\nIt supports four levels, default being `INFO`.\n\n    ERROR \u003e WARN \u003e INFO \u003e DEBUG\n\n\n## Usage\n\nSource the `tinylogger.bash` file, and use the `tlog` method.\nThe first argument is the level, and the second the log message.\n\n    source tinylogger.bash\n    tlog warn \"This is a warning\"\n\nSee [`demo.sh`](./demo.sh) for more.\n\nYou can control the logging level while calling a script by setting the `LOGGER_LVL` argument.\n\n    $ LOGGER_LVL=warn ./demo.sh\n\n```\n2017-11-07 19:05:30 - WARN - This is a scary warning\n2017-11-07 19:05:30 - ERROR - Something terrible has happened\n```\n\n    $ LOGGER_LVL=debug ./demo.sh\n\n```\n2017-11-07 19:05:52 - DEBUG - first line of script\n2017-11-07 19:05:52 - INFO - Starting script ./demo.sh\n2017-11-07 19:05:52 - DEBUG - another debug statement\n2017-11-07 19:05:52 - INFO - Current time is Tue  7 Nov 2017 19:05:52 GMT\n2017-11-07 19:05:52 - WARN - This is a scary warning\n2017-11-07 19:05:52 - DEBUG - do you like these debug statements?\n2017-11-07 19:05:52 - ERROR - Something terrible has happened\n2017-11-07 19:05:52 - DEBUG - end of script\n2017-11-07 19:05:52 - INFO - Script completed, go home\n```\n\nYou can set `LOGGER_LVL=none` to disable all logging.\n\n## Timestamp customisation\n\nUnderneath, the `date` command is used to display the timestamp. Simply set the `LOGGER_FMT` to any valid format supported by `date`.\n\n    $ LOGGER_LVL=warn LOGGER_FMT=%s ./demo.sh\n\n```\n1510081622 - WARN - This is a scary warning\n1510081622 - ERROR - Something terrible has happened\n```\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnk412%2Ftinylogger","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnk412%2Ftinylogger","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnk412%2Ftinylogger/lists"}