Repository navigation
docs: bring documentation in line with 3.0 - #174
Merged
Merged
Conversation
The README listed 7 suites and 201 tests. There are now more than 30 suites and the numbers go stale with every change. * group the suites by area instead of listing per-suite counts * tell the reader to run ./run_tests.sh to get current numbers * use N placeholders in the example output * link to docs/testing.md for cross-shell runs Closes #155 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01THRgLKXYXnVz5L4DgTE7hk
tests/README.md said Bash 4.0 and never mentioned cross-shell runs. docs/writing-tests.md had no guidance for tests that run under more than one shell. The writing-tests and running-tests skills did not mention TEST_SHELLS, so an agent changing logging.sh ran bash only. * tests/README.md: require bash 3.2, add a cross-shell run section * docs/writing-tests.md: add scenarios, known failures, golden files and the shell helpers in test_helpers.sh * skills: add the TEST_SHELLS command and say it is required after any change to logging.sh Closes #173 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01THRgLKXYXnVz5L4DgTE7hk
Findings INF-04 and INF-01 of the 3.0.0 security audit. * initialization.md: sourcing resets every setting, and only SCRIPT_NAME is inherited (init_logger sanitizes it). Replace the "may use LOG_FILE from environment" example and the unset list, and use --no-color, which is the real option, in place of --colors. * security-review skill: add the test_ prefix to the suite commands, replace the spoofable "readonly -p | grep" guard with _is_readonly and _logger_readonly, and name the _into sanitizer functions. * running-tests skill: the same missing test_ prefix, which also made its examples fail with "Test file not found". * sensitive-data.md, upgrading-to-3.0.md and the skill: list the characters that are kept on purpose (U+200E, U+200F, U+061C, U+200B and U+FEFF). Closes #167 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01THRgLKXYXnVz5L4DgTE7hk
The README still described the 2.x, Bash-only library. 3.0 is POSIX sh plus local and runs in bash 3.2+, bash --posix, zsh, dash and busybox ash. * reword the opening sentence and "Primary artifact" without "Bash" * add a Features bullet for shell support and update the sanitization bullet to terminal control sequences and other control characters * add a POSIX sh example to Quick Start next to the source example * move the "Upgrading from 2.x?" pointer into a NOTE block at the top Closes #169 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01THRgLKXYXnVz5L4DgTE7hk
The guides still described the 2.x, Bash-only library and used 2.7.0 as the install example. * replace "Bash Logging Module" with bash-logger in the guide introductions (docs/README.md says "the bash logging module") * getting-started: add a POSIX sh version of "Your First Script", and use <version> in the INSTALL_VERSION examples (2.x is unsupported) * examples: note that the examples are bash and add a POSIX sh example * troubleshooting: replace "Check your Bash version" with the supported shells and how to find each version, and add entries for [unknown] script names, "requires a value" and CONFIG notices on stderr, which changed in 3.0 * output-streams: &> works in bash 3.2 and zsh, not only Bash 4+ * configuration: use a neutral value in the example file header Closes #170 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01THRgLKXYXnVz5L4DgTE7hk
Two 3.0 log file changes were described only in upgrading-to-3.0.md. Every message text and mode below was checked against logging.sh and by running the library. * sensitive-data: add "re-checked on every write" and "private by default" to the measures list, add the runtime message, and drop the path from the "not writable" message, which logging.sh does not print * troubleshooting: add "Other Users Cannot Read the Log File" and the "now a symbolic link" entry, separate the init-time "not writable" error from the runtime "Failed to write" error, and replace the chmod 644 fixes with the mode a created file really has * initialization, getting-started, SECURITY: say who can read a created file and how to share it with a group Closes #171 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01THRgLKXYXnVz5L4DgTE7hk
Only runtime-configuration.md and upgrading-to-3.0.md described the 3.0 behaviour. Each statement below was checked against logging.sh and by running the library. * sensitive-data: rewrite the ANSI section around terminal control sequences and control characters, state that very long messages are cut before they are sanitized, and replace the dead examples.md link * initialization, configuration, api-reference: the unsafe ANSI option also keeps the other control characters, not only escape codes * api-reference: log_to_journal and set_journal_tag descriptions * journal-logging: add Tag Rules (what is rejected, the messages, the previous tag is kept, and the config file corrects instead) * journal-logging, testing: add "Using a Stub logger in Tests". A readonly LOGGER_PATH alone is not enough when a real logger is installed; the suites also replace _find_and_validate_logger and check_logger_available * troubleshooting: correct the tag row and add -t, --tag and set_journal_tag to the validation table Closes #172 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01THRgLKXYXnVz5L4DgTE7hk
Contributor
There was a problem hiding this comment.
Note
Copilot was unable to complete this review at the selected tier due to model policy or plan restrictions.
🟡 Changes recommended
Approval should be held until the two documented MarkdownLint MD013 line-length violations are addressed and the noted grammatical error in README.md is corrected.
2 open issues
What changed in this PR
This pull request updates the project’s documentation and contributor guidance to match bash-logger 3.0 behavior, replacing remaining 2.x-era Bash-only wording and refreshing examples and operational/security notes across the docs set.
Changes:
- Aligns README and guides with 3.0 behavior and shell-neutral / POSIX
sh-compatible examples where applicable. - Updates testing documentation and skills to reflect current suite structure, cross-shell workflows, and stub
loggerrequirements. - Refreshes security/troubleshooting guidance for 3.0 (sanitization wording, journald/tag behavior, secure log-file modes, symlink/runtime checks).
| File | Summary |
|---|---|
tests/README.md |
Reworks test-suite documentation and cross-shell run guidance. Nit: avoid contradicting the runner exclusions (test_example.sh, test_helpers.sh) when describing tests/test_*.sh suites. |
SECURITY.md |
Updates security guidance to reflect 3.0 behavior and secure defaults. Nit: add a trailing period to the noted list item for consistent punctuation. |
README.md |
Shell-neutral wording, 3.0 upgrade note, and POSIX sh quick start/example updates. Nit: wrap an overlong blockquote line and fix “a expansion” → “an expansion”. |
docs/writing-tests.md |
Expands test-writing guidance (scenarios, failures, golden files, helpers). Nit: wrap the noted overlong paragraph line to satisfy MD013. |
docs/upgrading-to-3.0.md |
Updates/clarifies 3.0 upgrade guidance and behavior notes. |
docs/troubleshooting.md |
Adds/updates 3.0 troubleshooting entries and clarifies behavior. |
docs/testing.md |
Documents testing workflows including stub logger patterns consistent with 3.0 validation. |
docs/sensitive-data.md |
Updates sanitization and sensitive-data handling guidance to match 3.0 behavior. |
docs/runtime-configuration.md |
Minor wording/positioning updates for 3.0. |
docs/README.md |
Updates docs index introduction wording to match current positioning. |
docs/output-streams.md |
Clarifies redirection guidance and shell applicability. |
docs/log-levels.md |
Updates wording to match current naming/behavior. |
docs/journal-logging.md |
Updates journald/tag rules documentation and related testing notes. |
docs/initialization.md |
Clarifies initialization behavior and environment inheritance in 3.0. |
docs/getting-started.md |
Updates getting-started steps, examples, and 3.0-era notes. |
docs/formatting.md |
Wording and guidance refresh consistent with 3.0 docs set. |
docs/examples.md |
Updates examples and clarifies shell expectations/compatibility. |
docs/configuration.md |
Refreshes configuration guidance and unsafe-mode wording. |
docs/api-reference.md |
Aligns reference docs with 3.0 behavior descriptions. |
.claude/skills/writing-tests/SKILL.md |
Updates skill guidance to match current test workflow and cross-shell expectations. |
.claude/skills/security-review/SKILL.md |
Updates security review guidance and references to match current conventions. |
.claude/skills/running-tests/SKILL.md |
Corrects/updates test-running guidance to match current suite/workflow naming. |
This pull request is ready to be approved.
Review effort: Balanced
* README: "a expansion" becomes "an expansion", and the gist note is wrapped so no line passes 200 characters * writing-tests: wrap a 203-character paragraph Refs #169 Refs #173 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01THRgLKXYXnVz5L4DgTE7hk
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Summary
Addresses the seven open documentation issues for the 3.0 release in one PR, with one commit per issue so each can be traced. The documents still described the 2.x, Bash-only library and left out several 3.0 behaviour changes.
Every message text, mode and behaviour that is now documented was checked against
logging.shand by running the library (bash and dash). zsh and busybox are not installed in the session, so statements about those shells come fromdocs/shell-compatibility.mdanddocs/upgrading-to-3.0.md.Changes
One commit per issue:
tests/README.md: replace the fixed suite counts with suites grouped by area, useNplaceholders in the example output, and point todocs/testing.mdtests/README.md(bash 3.2, cross-shell runs),docs/writing-tests.md(scenarios, known failures, golden files, shell helpers), and both test skills (TEST_SHELLScommand, required after any change tologging.sh)docs/initialization.md(onlySCRIPT_NAMEis inherited),security-reviewskill (test_prefix,_is_readonlyand_logger_readonly,_intonames), and the list of deliberately kept characters (INF-01)README.md: shell-neutral wording, a Features bullet and a POSIX sh Quick Start example, and an upgrade NOTE block at the top<version>placeholder forINSTALL_VERSION, shell-neutral "check your version" step, new troubleshooting entries,&>label, config headersensitive-data.md,troubleshooting.md,initialization.md,getting-started.mdandSECURITY.mdThings to review
These go beyond, or differ from, the issue text:
loggerneeds more thanreadonly([DOCS] Bring sanitization, tag validation and LOGGER_PATH docs in line with 3.0 #172 item 5). With a realloggerinstalled, a readonlyLOGGER_PATHalone is still refused, because validation finds a differentloggeronPATH. The docs show the pattern thattests/test_journal_logging.shuses (lock the stub and replace_find_and_validate_loggerandcheck_logger_available).docs/upgrading-to-3.0.mdstill says only "make the value readonly".tagkey corrects, it does not reject ([DOCS] Bring sanitization, tag validation and LOGGER_PATH docs in line with 3.0 #172 item 4).-t,--tagandset_journal_tagkeep the previous tag. The config file truncates to 64 characters or replaces unsafe characters with_. The Tag Rules section describes both.SCRIPT_NAMEis not sanitized beforeinit_loggerruns ([SECURITY] SCRIPT_NAME from the environment is used unsanitized before init_logger runs #165). Whichever of those PRs merges second should update the wording.running-testsskill: its examples (./tests/run_tests.sh log_levels) fail with "Test file not found". Fixed in the [DOCS] Update environment-variable docs and the security-review skill for 3.0 #167 commit together with thesecurity-reviewskill.--colors never(not an option) became--no-color, a dead../examples.mdlink was replaced, and the "not writable" message no longer shows a path thatlogging.shnever prints.Created log files have secure permissionspasses underumask 002. The docs follow the code and the upgrade guide.Testing
.mdfiles passmarkdownlint0.47.0 with.markdownlint.yaml(the version pinned in.pre-commit-config.yaml)scripts/validate-commit-msg.shloggerexamples, and the file modes under umask 022, 002 and 000./tests/run_tests.shgives 687 tests, 651 passed, 11 failed, 25 skipped.origin/maingives the same numbers and the same 11 failures. They are permission tests that fail because the session runs as root.Related issues
Closes #155
Closes #167
Closes #169
Closes #170
Closes #171
Closes #172
Closes #173
Refs #151
Refs #154
Refs #165
Generated by Claude Code