logx

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2022 License: MIT Imports: 8 Imported by: 0

README

xxx

介绍
  1. xxxx
  2. xxxx
  3. xxxx
安装教程

go get github.com/jageros/hawox

使用例子
package main

import (
	"fmt"
	"github.com/jageros/hawox/xxx"
)

func main() {
	/*
	xxxxx
	xxxxx
	xxxxx
	*/
}
使用说明
  1. xxxx
  2. xxxx
  3. xxxx

Documentation

Index

Constants

View Source
const (
	DebugLevel = "debug"
	InfoLevel  = "info"
	WarnLevel  = "warn"
	ErrorLevel = "error"
	PanicLevel = "panic"

	FileTypeLog     = "log"
	FileTypeRequest = "request_log"
)

Variables

This section is empty.

Functions

func Debug

func Debug(args ...interface{})

Debug 使用方法:log.Debug("test")

func Debugf

func Debugf(template string, args ...interface{})

Debugf 使用方法:log.Debugf("test:%s", err)

func Debugw

func Debugw(msg string, keysAndValues ...interface{})

Debugw 使用方法:log.Debugw("test", "field1", "value1", "field2", "value2")

func DisableZeroLog added in v0.1.5

func DisableZeroLog()

func Error

func Error(args ...interface{})

func Errorf

func Errorf(template string, args ...interface{})

func Errorw

func Errorw(msg string, keysAndValues ...interface{})

func Fatal

func Fatal(args ...interface{})

func Fatalf

func Fatalf(template string, args ...interface{})

func Fatalw

func Fatalw(msg string, keysAndValues ...interface{})

func Info

func Info(args ...interface{})

func Infof

func Infof(template string, args ...interface{})

func Infow

func Infow(msg string, keysAndValues ...interface{})

func Init

func Init(level string, options ...Option)

Init init logger

func NewZapAdapter

func NewZapAdapter(level string) *zapAdapter

func Panic

func Panic(args ...interface{})

func Panicf

func Panicf(template string, args ...interface{})

func Panicw

func Panicw(msg string, keysAndValues ...interface{})

func RequestLogInfow

func RequestLogInfow(msg string, keysAndValues ...interface{})

func SetupZeroLog added in v0.1.5

func SetupZeroLog(c logx.LogConf)

func Sync

func Sync()

Sync flushes buffer, if any

func Warn

func Warn(args ...interface{})

func Warnf

func Warnf(template string, args ...interface{})

func Warnw

func Warnw(msg string, keysAndValues ...interface{})

func WriteIO

func WriteIO() io.Writer

Types

type Log

type Log struct {
	Path           string
	Level          string
	NeedRequestLog bool
	// contains filtered or unexported fields
}

func Logger

func Logger() *Log

func (*Log) Write

func (l *Log) Write(p []byte) (n int, err error)

type Option

type Option interface {
	// contains filtered or unexported methods
}

func SetCaller

func SetCaller() Option

func SetCompress

func SetCompress(compress bool) Option

func SetFileOut

func SetFileOut(dir string, appName string) Option

func SetMaxAge

func SetMaxAge(age int) Option

func SetMaxBackups

func SetMaxBackups(n int) Option

func SetMaxFileSize

func SetMaxFileSize(size int) Option

func SetRequest

func SetRequest() Option

func SetSource

func SetSource(source string) Option

Jump to

Keyboard shortcuts

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