gxlog

package
v0.3.3 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2020 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

package gxlog is based on log4go. color.go provides colorful terminal log output functions.

based on log4go.

package gxlog is based on log4go. pretty.go provides pretty format string

Index

Constants

This section is empty.

Variables

View Source
var (
	// Normal colors
	// NORMAL   = []byte{'\033', '0', 'm'}
	NORMAL   = []byte{'\033', '0'}
	NBlack   = []byte{'\033', '[', '3', '0', 'm'}
	NRed     = []byte{'\033', '[', '3', '1', 'm'}
	NGreen   = []byte{'\033', '[', '3', '2', 'm'}
	NYellow  = []byte{'\033', '[', '3', '3', 'm'}
	NBlue    = []byte{'\033', '[', '3', '4', 'm'}
	NMagenta = []byte{'\033', '[', '3', '5', 'm'}
	NCyan    = []byte{'\033', '[', '3', '6', 'm'}
	NWhite   = []byte{'\033', '[', '3', '7', 'm'}
	// Bright colors
	BBlack                    = []byte{'\033', '[', '3', '0', ';', '1', 'm'}
	BRed                      = []byte{'\033', '[', '3', '1', ';', '1', 'm'}
	BGreen                    = []byte{'\033', '[', '3', '2', ';', '1', 'm'}
	BYellow                   = []byte{'\033', '[', '3', '3', ';', '1', 'm'}
	BBlue                     = []byte{'\033', '[', '3', '4', ';', '1', 'm'}
	BMagenta                  = []byte{'\033', '[', '3', '5', ';', '1', 'm'}
	BCyan                     = []byte{'\033', '[', '3', '6', ';', '1', 'm'}
	BWhite                    = []byte{'\033', '[', '3', '7', ';', '1', 'm'}
	UnderlineTwinkleHighLight = []byte{'\033', '[', '1', ';', '6', ';', '4', '0', 'm'}
)

Functions

func CDebug

func CDebug(format string, args ...interface{})

func CEPrintf

func CEPrintf(color []byte, format string, args ...interface{})

func CEPrintfln

func CEPrintfln(color []byte, format string, args ...interface{})

func CError

func CError(format string, args ...interface{})

func CFatal

func CFatal(format string, args ...interface{})

func CInfo

func CInfo(format string, args ...interface{})

func CPrintf

func CPrintf(color []byte, format string, args ...interface{})

func CPrintfln

func CPrintfln(color []byte, format string, args ...interface{})

func CWarn

func CWarn(format string, args ...interface{})

func ColorPrint

func ColorPrint(i interface{})

func ColorPrintf

func ColorPrintf(fmt string, args ...interface{})

func ColorPrintln

func ColorPrintln(i interface{})

func ColorSprint added in v0.2.0

func ColorSprint(i interface{}) string

func ColorSprintf added in v0.2.0

func ColorSprintf(fmt string, args ...interface{}) string

func ColorSprintln added in v0.2.0

func ColorSprintln(i interface{}) string

func PrettyString

func PrettyString(i interface{}) string

Types

type Conf

type Conf struct {
	Name      string // application name
	Dir       string // logger directory
	Level     string // minimum log level
	Console   bool   // whether output log to console
	Daily     bool   // whether rotate log file at mid-night every day
	Hourly    bool   // whether rotate log file every one hour. If true, the Daily will be set false.
	BackupNum int    // log file backup number. the oldest is deleted.
	BufSize   int    // async logger buffer size
	Json      bool   // whether output json log
}

type Logger

type Logger struct {
	log4go.Logger
}

func NewLogger

func NewLogger(conf Conf) (Logger, error)

init a logger

func NewLoggerWithConfFile

func NewLoggerWithConfFile(conf string) Logger

Directories

Path Synopsis
Package gxkafka encapsulates some kafka functions based on github.com/Shopify/sarama.
Package gxkafka encapsulates some kafka functions based on github.com/Shopify/sarama.

Jump to

Keyboard shortcuts

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