Simple Logging Facade for Shell
bpkg install jeremfg/slf4.sh
or
bpkg install -g jeremfg/slf4.sh
NOTE: bpkg itself can easily be installed by calling
curl -sLo- https://get.bpkg.sh | bash
In the first case, the library is installed local to your project.
You will need to source deps/slf4.sh/src/slf4.sh
.
In the second case, the library is installed globally.
You will need to source ${HOME}/.local/lib/slf4.sh
.
Provides the following functions:
logTest()
logTrace()
logDebug()
logInfo()
logWarn()
logError()
logFatal()
logSetLevel()
You can either pass your log message as an argument, or pipe straight into it. See examples below:
logWarn "An error occured on $(hostname)"
logError <<EOF
This is a detailed bug report
$(date)
$(hostname)
A lot of stuff happened!
EOF
Once you've checked out this repository call the following:
./tool/setup
To create a release, call
./tool_release <version>
Where <version>
is a semantic version 2.0.0 version number
- Document using shdoc: https://github.com/reconquest/shdoc
- Add color per log level
- Add PÎD (Process ID) to the printed message metadata