Working but no color
For example, here is my simple script using log4bash.sh
#!/bin/bash
source log4bash.sh
log "COOL"
log_warning "HELP!"
log_info "AWESOME"
log_success "WEWEWEWE"
log_error "ERROR!"
and the output is -
[2016-12-02 22:27:20 UTC] [INFO] COOL
[2016-12-02 22:27:20 UTC] [WARNING] HELP!
[2016-12-02 22:27:20 UTC] [INFO] AWESOME
[2016-12-02 22:27:20 UTC] [SUCCESS] WEWEWEWE
[2016-12-02 22:27:20 UTC] [ERROR] ERROR!
working fine, but no colo(u)r.
Thanks in advance.
I noticed this problem on Linux systems. It comes down to line 19 being a special case for macOS, and it doesn't work right on Linux/BSD/etc. Uncommenting line 18 and removing line 19 might do the job, but I haven't tested, as I rewrote the whole test to work across other shells.
I noticed this problem on Linux systems. It comes down to line 19 being a special case for macOS, and it doesn't work right on Linux/BSD/etc. Uncommenting line 18 and removing line 19 might do the job, but I haven't tested, as I rewrote the whole test to work across other shells.
Hi, It doesn't work on Ubuntu 18.04 Any suggestions ?
TNX
I ended up forking and rewriting a bit to make it work on all POSIX shells and remove the Mac OS X-isms. I converted it to use tput for colors, which abstracts the color code so that it works on any system with a correctly configured termcap (and the tput command). My fork is here: https://github.com/swelljoe/slog
My fork doesn't have exactly the same semantics, so you'll need to modify your code a little, if you've been using log4bash.