fshlib: shell library

January 3, 2026

fshlib

fshlib is a simple shell library for logging. It provides a set of functions to log messages with different severity levels.

Github repo: https://github.com/filmil/fshlib

Test Publish BCR Publish Tag and Release

Usage

To use the library, source the log.bash file in your script:

source "path/to/log.bash"

Then you can use the logging functions:

log::info "This is an info message"
log::warn "This is a warning message"
log::error "This is an error message"

Functions

  • log::info: Logs an informational message.
  • log::warn: Logs a warning message.
  • log::error: Logs an error message.
  • log::debug: Logs a debug message. This message is only shown if the DEBUG environment variable is set to true or log.
  • log::prefix: Prefixes each line of the input with a given string.

Example

#!/usr/bin/env bash

source "path/to/log.bash"

log::info "Starting the script"
log::warn "Something might be wrong"
log::error "Something went wrong"

echo "some output" | log::prefix "[my-prefix] "