20 lines
429 B
Fish
Executable File
20 lines
429 B
Fish
Executable File
#!/usr/bin/env fish
|
|
import parent
|
|
|
|
# calls logger with a specific color
|
|
#
|
|
# examples:
|
|
#
|
|
# log "hello there"
|
|
# log -c magenta "im berry"
|
|
# log --color cc00cc "just like the blueberries"
|
|
function log
|
|
set -f log_name (parent)
|
|
argparse 'c/color=' -- $argv
|
|
if not set -q _flag_color;
|
|
set -g _flag_color green
|
|
end
|
|
|
|
echo -s "[ " (set_color $_flag_color) $log_name (set_color normal) " ]: $argv" 1>&2
|
|
end
|