llog

package module
v0.0.0-...-981d0b3 Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2014 License: MIT Imports: 5 Imported by: 2

README

LLOG

Installation

go get github.com/awsmsrc/llog

About

Brutally simple leveled logging package with color support

docs can be found @ http://godoc.org/github.com/awsmsrc/llog

TODO

  • color options
  • turn off colors
  • add a level var to a logger so it can be switched at run time
  • pottentially buffererd logging as in Rop Pikes glog

Documentation

Overview

llog is a simple *leveled* logging packages originally writen and used in Go services at Sqwiggle (https://www.sqwiggle.com). The API is designed to be conceptually similar to the standard library's log package

Index

Constants

View Source
const (
	RED     = "\033[31m"
	GREEN   = "\033[32m"
	YELLOW  = "\033[93m"
	CYAN    = "\033[36m"
	MAGENTA = "\033[95m"
	RESET   = "\033[0m"
)
View Source
const (
	LevelNull = iota
	LevelDebug
	LevelInfo
	LevelWarn
	LevelError
)

The available log levels are { levelNull:no logging, levelDebug:log out everything, levelInfo: log out Info, Warn, Error, Succes and FATAL, LevelWarn: log out Warn, Error, Success and FATAL and finally LevelError: log out Error, Success and FATAL}

Variables

This section is empty.

Functions

func Debug

func Debug(s interface{})

func Debugf

func Debugf(s interface{}, a ...interface{})

func Error

func Error(s interface{})

func Errorf

func Errorf(s interface{}, a ...interface{})

func FATAL

func FATAL(s interface{})

func Info

func Info(s interface{})

func Infof

func Infof(s interface{}, a ...interface{})

func SetLevel

func SetLevel(i int) error

func Success

func Success(s interface{})

func Successf

func Successf(s interface{}, a ...interface{})

func Warn

func Warn(s interface{})

func Warnf

func Warnf(s interface{}, a ...interface{})

Types

type Logger

type Logger struct {
	io.Writer
}

llog.Logger wraps/embeds a writer so that you can log where ever you like. This package defaults to logging to os.Stdout

func (*Logger) Debug

func (l *Logger) Debug(s interface{})

func (*Logger) Debugf

func (l *Logger) Debugf(s interface{}, a ...interface{})

func (*Logger) Error

func (l *Logger) Error(s interface{})

func (*Logger) Errorf

func (l *Logger) Errorf(s interface{}, a ...interface{})

func (*Logger) FATAL

func (l *Logger) FATAL(s interface{})

func (*Logger) Info

func (l *Logger) Info(s interface{})

func (*Logger) Infof

func (l *Logger) Infof(s interface{}, a ...interface{})

func (*Logger) Success

func (l *Logger) Success(s interface{})

func (*Logger) Successf

func (l *Logger) Successf(s interface{}, a ...interface{})

func (*Logger) Warn

func (l *Logger) Warn(s interface{})

func (*Logger) Warnf

func (l *Logger) Warnf(s interface{}, a ...interface{})

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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