From 8359198e5edb272311e10c77e6bf4cb662abd5ec Mon Sep 17 00:00:00 2001 From: Adam Mathes Date: Sat, 25 Feb 2017 17:50:38 -0800 Subject: silent by default, verbose option added. -feeds cmd line option added --- vlog/vlog.go | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 vlog/vlog.go (limited to 'vlog') diff --git a/vlog/vlog.go b/vlog/vlog.go new file mode 100644 index 0000000..ab48478 --- /dev/null +++ b/vlog/vlog.go @@ -0,0 +1,25 @@ +// vlog -- verbose logger -- wraps log functions and only performs them if "verbose" +package vlog + +import ( + "fmt" +) + +var VERBOSE bool + +func init() { + VERBOSE=false +} + +func Printf(format string, v ...interface{}) { + if VERBOSE { + fmt.Printf(format, v...) + } +} + +func Println(v ...interface{}) { + if VERBOSE { + fmt.Println(v...) + } +} + -- cgit v1.2.3