starkandwayne/goutils

Name: goutils

Owner: Stark & Wayne

Description: S&W Go Utilities

Created: 2015-11-20 17:49:34.0

Updated: 2016-07-11 17:04:45.0

Pushed: 2017-11-19 04:37:18.0

Homepage: null

Size: 582

Language: Go

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

goutils

S&W Go Utilities

NOTICE: THIS REPOSITORY IS BEING RETIRED

You may want to refer to these other repos, which will be supported moving forward:

Additionally, timestamp and botta are both being deprecated for lack of use.

How To Use

Get:

et github.com/starkandwayne/goutils/{{pkg}}

Import:

rt "github.com/starkandwayne/goutils/{{pkg}}"
Log

Setup logging with SetupLogging():

e.g.:

SetupLogging(LogConfig{ Type: "console", Level: "warning" })

If logging is not setup, then the messages will simply go to stdout. If logging cannot be setup for file or syslog, then the default stdout will be used. An error message will print to stderr to notify you if this occurs.

Log has the following levels defined:

Usage is the same as Sprintf/Printf statements - simply append an f to the desired level. e.g.:

_mesg := "This isn't a bug."
Debugf("I really need to know this in debug mode: %s", dbug_mesg)

This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.