{"id":17083592,"url":"https://github.com/gnikonorov/bog","last_synced_at":"2026-05-04T19:31:37.636Z","repository":{"id":119155578,"uuid":"153974673","full_name":"gnikonorov/bog","owner":"gnikonorov","description":"Logging framework for bash scripts","archived":false,"fork":false,"pushed_at":"2018-10-24T03:42:38.000Z","size":13,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-28T19:34:23.417Z","etag":null,"topics":["bash","logger","logging","logging-library","shell"],"latest_commit_sha":null,"homepage":null,"language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"unlicense","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gnikonorov.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":"2018-10-21T04:53:32.000Z","updated_at":"2020-08-26T19:51:38.000Z","dependencies_parsed_at":"2023-07-10T01:15:29.326Z","dependency_job_id":null,"html_url":"https://github.com/gnikonorov/bog","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/gnikonorov%2Fbog","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gnikonorov%2Fbog/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gnikonorov%2Fbog/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gnikonorov%2Fbog/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gnikonorov","download_url":"https://codeload.github.com/gnikonorov/bog/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245106649,"owners_count":20561746,"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","logger","logging","logging-library","shell"],"created_at":"2024-10-14T13:02:57.838Z","updated_at":"2026-05-04T19:31:33.831Z","avatar_url":"https://github.com/gnikonorov.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# bog\n\n`Bog` is a lightweight logging solution for bash scripts.\n\n## Overview\n\n```\nsource 'bog.sh'\n\nbog_log_debug   \"This is a debug message\"\nbog_log_info    \"This is an info message\"\nbog_log_warning \"This is a warning message\"\nbog_log_error   \"This is an error message\"\nbog_log_fatal   \"This is a fatal message\"\n```\n\n```\n$ ./test.sh\nDEBUG: Sun Oct 21 16:14:39 EDT 2018 - This is a debug message\nINFO: Sun Oct 21 16:14:39 EDT 2018 - This is an info message\nWARNING: Sun Oct 21 16:14:39 EDT 2018 - This is a warning message\nERROR: Sun Oct 21 16:14:39 EDT 2018 - This is an error message\nFATAL: Sun Oct 21 16:14:39 EDT 2018 - This is a fatal message\n$\n```\n`Bog` is easy to include in your shell scripts. Just source `bog.sh`.\n\n### Logging levels\n\nBog implements the following logging levels:\n* DEBUG\n* INFO\n* WARNING\n* ERROR\n* FATAL\n\n### Logging modes\n\nBog allows logging modes:\n* To set the mode: `bog_set_log_mode $BOG_LOG_TO_FILE`.\n* The following modes are supported:\n  * `$BOG_LOG_TO_STDOUT_STDERR`: Logs output to `STDOUT`/`STDERR`\n    * In this mode `DEBUG`, `INFO`, and `WARNING` messages will go to `STDOUT` and `ERROR` and `FATAL` messages will go to `STDERR`\n  * `$BOG_LOG_TO_FILE`: Logs output to a file\n  * `$BOG_LOG_TO_BOTH`: Logs output to `STDOUT`/`STDERR`, and also to a file\n\n### Log file names\n\nBog allows you to specify the name of a file to write to. To specify a filename:\n* `bog_set_log_file \"my_log_file.log\"`\n\nBy default, the file used is `bog.log`. Do not use this function to specify a log file path. If you would like to specify a path, please see the `Log directory` section directly below.\n\n### Log directory\n\nBog allows you to specify the directory in which to store logs. If you do not specify a value, `.` ( the current directory ) is used. You may specify any valid folder structure the process will have write access to.\n\nA flag may be passed to indicate you wish to create any necessary folders. By default, no folders are created.\n\nTo specify a log directory and not create any folders:\n* `bog_set_log_directory \"/dir/not/created/if/dne\" 0`\n* `bog_set_log_directory \"/dir/not/created/if/dne\"`\n\nTo specify a log directory and create all needed subfolders:\n* `bog_set_log_directory \"/dir/created/if/dne\" 1`\n* `bog_set_log_directory \"/dir/created/if/dne\" peat`\n* `bog_set_log_directory \"/dir/created/if/dne\" marsh`\n\n### Log entry format\n\nBog log entries are of form `\u003cLEVEL\u003e: \u003cTIME\u003e - \u003cMESSAGE\u003e`. For example:\n```\nDEBUG: Sun Oct 21 16:14:39 EDT 2018 - This is a debug message\n```\n\nThe timestamp is taken from running `date`, and you can specify the timestamp by providing a `date` compatable format string. For example:\n```\nbog_set_timestamp_format '%T'\nbog_log_debug \"This is a debug message\"\n```\n\nWould yield:\n```\nDEBUG: 16:28:12 - This is a debug message\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgnikonorov%2Fbog","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgnikonorov%2Fbog","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgnikonorov%2Fbog/lists"}