log

package
v0.5.5 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2020 License: MIT Imports: 9 Imported by: 3

Documentation

Overview

Package log implements a simple logging package.

package main

import (
	"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 RegisterFileSystem added in v0.5.4

func RegisterFileSystem(name string, fs FileSystem)

Types

type FileSystem added in v0.5.4

type FileSystem 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) 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) Print

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

func (*Logger) Printf

func (l *Logger) Printf(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