utils

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddLog

func AddLog(l1 _log.Logger)

AddLog to add logger chain.

func Error

func Error(str string, args ...interface{})

Error to print error.

func Fatal

func Fatal(str string, args ...interface{})

Fatal to log fatal.

func GetLogger

func GetLogger(i ...int) _log.Logger

GetLogger to get logger.

func Info

func Info(str string, args ...interface{})

Info to log info.

func InitLog

func InitLog(lvl LogLevel, json, color bool)

InitLog to init global logger.

func Log

func Log(field map[string]interface{})

Log to log with custom field.

func ParseDuration

func ParseDuration(isoDuration string) time.Duration

ParseDuration parses an ISO 8601 string representing a duration, and returns the resultant golang time.Duration instance.

func Thousands

func Thousands(num int) string

Thousands to format int to thousands string format.

Types

type LogLevel

type LogLevel int8

LogLevel is level of log that will be printed. Will print level that is higher than your chosen one.

const (
	TraceLevel LogLevel = iota - 1
	DebugLevel
	InfoLevel
	WarnLevel
	ErrorLevel
	FatalLevel
	PanicLevel
	Disabled
)

Available log level.

Jump to

Keyboard shortcuts

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