slog

package
v0.0.0-...-7afe134 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2014 License: MIT, MIT Imports: 7 Imported by: 0

README

slog

Cross-platform logger for Go

Documentation

Overview

Package slog provides a cross-platform logging interface. It is designed to provide a universal logging interface on any operating system. It defaults to using the log package of the standard library, but can easily be used with other logging backends. Thus, we can use syslog on unicies and the event log on windows.

Index

Constants

This section is empty.

Variables

View Source
var (
	// LogLineNumber prints the file and line number of the caller.
	LogLineNumber = true
)

Functions

func Error

func Error(v ...interface{})

func Errorf

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

func Errorln

func Errorln(v ...interface{})

func Fatal

func Fatal(v ...interface{})

func Fatalf

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

func Fatalln

func Fatalln(v ...interface{})

func Info

func Info(v ...interface{})

func Infof

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

func Infoln

func Infoln(v ...interface{})

func Set

func Set(l Logger)

func SetSyslog

func SetSyslog() error

func Warning

func Warning(v ...interface{})

func Warningf

func Warningf(format string, v ...interface{})

func Warningln

func Warningln(v ...interface{})

Types

type Logger

type Logger interface {
	Error(v string)
	Info(v string)
	Warning(v string)
	Fatal(v string)
}

type StdLog

type StdLog struct {
	Log *log.Logger
}

func (*StdLog) Error

func (s *StdLog) Error(v string)

func (*StdLog) Fatal

func (s *StdLog) Fatal(v string)

func (*StdLog) Info

func (s *StdLog) Info(v string)

func (*StdLog) Warning

func (s *StdLog) Warning(v string)

type Syslog

type Syslog struct {
	W *syslog.Writer
}

func (*Syslog) Error

func (s *Syslog) Error(v string)

func (*Syslog) Fatal

func (s *Syslog) Fatal(v string)

func (*Syslog) Info

func (s *Syslog) Info(v string)

func (*Syslog) Warning

func (s *Syslog) Warning(v string)

Jump to

Keyboard shortcuts

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