-
Notifications
You must be signed in to change notification settings - Fork 28
/
log.sh
55 lines (45 loc) · 1.06 KB
/
log.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#!/usr/bin/env bash
# ======================================================================
#
# NAME
#
# log.sh
#
# DESCRIPTION
#
# A library of bash functions for writing formatted log messages to
# standard output and standard error.
#
# USAGE
#
# If you would like to use this library in your bash script, then
# source it at the beginning of your bash script.
#
# source log.sh
#
# Once the library has been sourced, you can call functions from the
# library in your bash script.
#
# AUTHOR
#
# Marty Kandes, Ph.D.
# Computational & Data Science Research Specialist
# High-Performance Computing User Services Group
# San Diego Supercomputer Center
# University of California, San Diego
#
# LAST UPDATED
#
# Monday, December 28th, 2020
#
# ----------------------------------------------------------------------
log::output() {
echo "${@}" >&1
}
log::error() {
echo "ERROR :: ${@}" >&2
}
log::warning() {
echo "WARNING :: ${@}" >&2
}
# ======================================================================