log

package module
v0.0.0-...-95a3d09 Latest Latest
Warning

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

Go to latest
Published: May 30, 2015 License: MIT Imports: 6 Imported by: 0

README

go-minimal-log wercker status

Simple go logger similar to Perl's Log::Minimal

Usage

import "github.com/typester/go-minimal-log"

log.Debugf("%s", "foo") // 2014/08/19 09:16:23 example.go:12: [debug] foo

Change log level
log.LogLevel = log.INFO

Available levels are:

  • MUTE
  • DEBUG
  • INFO
  • WARN
  • CRITICAL
  • ERROR

Author

Daisuke Murase (typester)

License

MIT

Documentation

Index

Constants

View Source
const (
	MUTE = iota
	DEBUG
	INFO
	WARN
	CRITICAL
	ERROR = 99
)

Variables

View Source
var Colors = map[int]color{
	DEBUG:    {ct.White, false},
	INFO:     {ct.Green, false},
	WARN:     {ct.Yellow, false},
	CRITICAL: {ct.Red, true},
	ERROR:    {ct.Red, false},
}
View Source
var LogLevel = DEBUG

configurations

View Source
var Logger = l.New(defaultOutput, "", l.LstdFlags|l.Lshortfile)
View Source
var Tags = map[int]string{
	DEBUG:    "debug",
	INFO:     "info",
	WARN:     "warn",
	CRITICAL: "critical",
	ERROR:    "error",
}

Functions

func Crit

func Crit(args ...interface{})

func Critf

func Critf(format string, args ...interface{})

func Debug

func Debug(args ...interface{})

func Debugf

func Debugf(format string, args ...interface{})

func Error

func Error(args ...interface{})

func Errorf

func Errorf(format string, args ...interface{})

func Fatal

func Fatal(args ...interface{})

func Fatalf

func Fatalf(format string, args ...interface{})

func Info

func Info(args ...interface{})

func Infof

func Infof(format string, args ...interface{})

func SetFlags

func SetFlags(flags int)

func SetOutput

func SetOutput(out io.Writer)

func SetPrefix

func SetPrefix(prefix string)

func Warn

func Warn(args ...interface{})

func Warnf

func Warnf(format string, args ...interface{})

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL