package module
Version: v0.0.0-...-ddf5806 Latest Latest

This package is not in the latest version of its module.

Go to latest
Published: Apr 30, 2016 License: MIT Imports: 6 Imported by: 0



A simple logging framework for golang



Used for debug output. Switch to false if we release. This could also be done by a makefile using different source codes (see https://groups.google.com/d/msg/golang-nuts/gU7oQGoCkmg/xlVJx-OJ9EUJ )



View Source
const KBLU = "\x1B[34m"
View Source
const KCYN = "\x1B[36m"
View Source
const KFNT = "\x1B[2m"

Faint (decreased intensity, not widely supported)

View Source
const KGRN = "\x1B[32m"
View Source
const KMAG = "\x1B[35m"
View Source
const KNRM = "\x1B[0m"


View Source
const KRED = "\x1B[31m"

Other colors

View Source
const KRESET = "\033[0m"
View Source
const KWHT = "\x1B[37m"
View Source
const KYEL = "\x1B[33m"


View Source
var Debugging debug = true

var Debugging can be set in production without any security risks, it enables debugging log-output.

View Source
var Develop = true

var Develop SHOULD NEVER EVER be set in Prod, it is used to disable security-relevant features in the using library


func D

func D(tag Tag, format string, args ...interface{})

func D prints a debug message - development only

func E

func E(tag Tag, format string, args ...interface{}) int64

func E prints an error, with stacktrace - IMMEDIATELY FIX THIS!

func GetRequest

func GetRequest(r *http.Request) interface{}

func GetRequest prints a http-Request, if we are in develop the full request, otherwise only Method & url without parameters

func I

func I(tag Tag, format string, args ...interface{}) int64

func I prints a info message - will be in production mode, e.g. for registration finished, map uploaded etc.

func V

func V(tag Tag, format string, args ...interface{})

func V prints a verbose message - development only (importance below debug, e.g. for big variable prints)

func W

func W(tag Tag, format string, args ...interface{}) int64

func W prints a warning - something went bad, but the process can be continued. Only allowed in special cases

func WTF

func WTF(tag Tag, format string, args ...interface{}) int64

func WTF prints a WTF - "What a terrible failure"


type Tag

type Tag string

Source Files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL