log

package
v0.1.7 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2019 License: MIT Imports: 10 Imported by: 3

Documentation

Overview

Package log ...

package main

import (
	"sync"
	"github.com/ije/gox/log"
)

func main() {
    log, err := log.New("file:/var/log/error.log?buffer=32kb")
    if err != nil {
        return
    }
    log.Info("Hello World!")
}

Index

Constants

This section is empty.

Variables

View Source
var ErrorArgumentFormat = fmt.Errorf("invalid argument format")

Functions

func Drivers

func Drivers() (list []string)

func Register

func Register(name string, driver Driver)

Types

type Driver

type Driver interface {
	Open(addr string, args map[string]string) (writer io.Writer, err error)
}

type Level

type Level int8
const (
	L_DEBUG Level = iota
	L_INFO
	L_WARN
	L_ERROR
	L_FATAL
)

func LevelByName

func LevelByName(name string) (l Level)

type Logger

type Logger struct {
	// contains filtered or unexported fields
}

func New

func New(url string) (*Logger, error)

func (*Logger) Debug

func (l *Logger) Debug(v ...interface{})

func (*Logger) Debugf

func (l *Logger) Debugf(format string, v ...interface{})

func (*Logger) Error

func (l *Logger) Error(v ...interface{})

func (*Logger) Errorf

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

func (*Logger) Fatal

func (l *Logger) Fatal(v ...interface{})

func (*Logger) Fatalf

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

func (*Logger) FlushBuffer

func (l *Logger) FlushBuffer() (err error)

func (*Logger) Info

func (l *Logger) Info(v ...interface{})

func (*Logger) Infof

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

func (*Logger) Log

func (l *Logger) Log(v ...interface{})

func (*Logger) Logf

func (l *Logger) Logf(format string, v ...interface{})

func (*Logger) SetBuffer

func (l *Logger) SetBuffer(cap int)

func (*Logger) SetLevel

func (l *Logger) SetLevel(level Level)

func (*Logger) SetLevelByName

func (l *Logger) SetLevelByName(name string)

func (*Logger) SetOutput

func (l *Logger) SetOutput(output io.Writer)

func (*Logger) SetPrefix

func (l *Logger) SetPrefix(prefix string)

func (*Logger) SetQuite

func (l *Logger) SetQuite(quite bool)

func (*Logger) Warn

func (l *Logger) Warn(v ...interface{})

func (*Logger) Warnf

func (l *Logger) Warnf(format string, v ...interface{})

Jump to

Keyboard shortcuts

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