log

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2020 License: MIT Imports: 9 Imported by: 3

Documentation

Overview

Package log ...

package main

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

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

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Register

func Register(name string, fs FS)

Types

type FS added in v0.2.0

type FS interface {
	Open(path 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)

func (Level) String added in v0.2.0

func (l Level) String() string

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) Debugln added in v0.2.0

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

func (*Logger) Error

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

func (*Logger) Errorf

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

func (*Logger) Errorln added in v0.2.0

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

func (*Logger) Fatal

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

func (*Logger) Fatalf

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

func (*Logger) Fatalln added in v0.2.0

func (l *Logger) Fatalln(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) Infoln added in v0.2.0

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

func (*Logger) Print

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

func (*Logger) Printf

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

func (*Logger) Println added in v0.2.0

func (l *Logger) Println(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{})

func (*Logger) Warnln added in v0.2.0

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

Jump to

Keyboard shortcuts

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