A while back I started working on a tool for debugging in Bash scripts. I basically just wanted a shorthand for using the logger
command in Bash. Logr has grown over time, so I thought I’d share it as a project. It’s a work in progress, really, and I’m very open to suggestions.
I set up a project page with full configuration and usage details. I won’t post a bunch of code in this post, but I’ll give a quick example and you can decide if you’d like to see more…
#!/bin/bash
logr info "A quick info message, only goes to custom log"
logr debug "A debug message that includes a full function backtrace"
logr err "An <ERROR> log entry that goes to custom log and system.log"
All the output can be sent to STDERR as well as a custom logfile, or silenced so you can just watch with tail -f
in another window. If this sounds useful, check out the project page.
Ryan Irelan has produced a series of shell trick videos based on BrettTerpstra.com posts. Readers can get 10% off using the coupon code TERPSTRA
.