chore(unitproc/bkt-processArgs):Update with die()
[BK-2020-03.git] / unitproc / bkt-vbm
CommitLineData
a22c56b3 1#!/bin/bash
2928a8e4 2# Desc: Display message if opVerbose true
a22c56b3
SBS
3
4vbm() {
2928a8e4 5 # Description: Prints verbose message ("vbm") to stderr if opVerbose is set to "true".
dee109ac 6 # Usage: vbm "DEBUG :verbose message here"
2928a8e4 7 # Version 0.2.0
a22c56b3 8 # Input: arg1: string
2928a8e4 9 # vars: opVerbose
a22c56b3 10 # Output: stderr
bb715c40 11 # Depends: bash 5.0.3, echo 8.30, date 8.30
a22c56b3 12
2928a8e4
SBS
13 if [ "$opVerbose" = "true" ]; then
14 functionTime="$(date --iso-8601=ns)"; # Save current time in nano seconds.
15 echo "[$functionTime]:$0:""$*" 1>&2; # Display argument text.
a22c56b3
SBS
16 fi
17
18 # End function
19 return 0; # Function finished.
2928a8e4 20} # Displays message if opVerbose true
a22c56b3 21
dee109ac
SBS
22#==BEGIN sample code==
23vbm "STATUS:This is a status message.";
2928a8e4 24opVerbose="true";
dee109ac
SBS
25vbm "STATUS:This is another status message.";
26#==END sample code==
27
a22c56b3
SBS
28# Author: Steven Baltakatei Sandoval
29# License: GPLv3+