log

package
v0.0.0-...-4273fad Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2019 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Copyright 2018-2019 The trust-net Authors a logger uitility method

Index

Constants

View Source
const (
	DEBUG = uint(1)
	INFO  = uint(2)
	ERROR = uint(3)
	NONE  = uint(1 << 10)
)

log levels

View Source
const (
	EnvLogfile     = "LOG_FILE"
	DefaultLogFile = "app.log"
)

Variables

This section is empty.

Functions

func GetLogFile

func GetLogFile() *os.File

func GetLogLevel

func GetLogLevel() uint

func SetLogLevel

func SetLogLevel(level uint)

Types

type Logger

type Logger interface {
	// log message with DEBUG log level, only if log level is DEBUG or lower
	Debug(format string, args ...interface{})
	// log message with INFO log level, only if log level is INFO or lower
	Info(format string, args ...interface{})
	// log message with ERROR log level, only if log level is ERROR or lower
	Error(format string, args ...interface{})
}

func AppLogger

func AppLogger() Logger

func NewLogger

func NewLogger(name interface{}) Logger

Jump to

Keyboard shortcuts

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