logger

package
v0.1.41 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2025 License: MIT Imports: 9 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package logger provides a simple logging package.

Index

Constants

View Source
const (
	LEVEL_NOSET = iota
	LEVEL_DEBUG
	LEVEL_INFO
	LEVEL_WARNING
	LEVEL_ERROR
	LEVEL_FATAL
	LEVEL_SUCCESS
)
View Source
const (
	FatalEmoji   = "☠️"
	DebugEmoji   = "🐞"
	InfoEmoji    = "🦋"
	SuccessEmoji = "🎉"
	ErrorEmoji   = "💔"
	WarningEmoji = "⚠️"
)

This is the set of emoji definition.

Variables

View Source
var (

	// Level defines the level of the logger. It's a global option and affects
	Level = LEVEL_NOSET

	FilelineFlag = false
	//TimeStamps defines if the output has timestamps or not. It's a global option and affects all methods.
	TimeStamps = true
	// Color defines if the output has color or not. It's a global option and affects all methods.
	Color = true
	// BackgroundColor defines if the output has background color or not. It's a global option and affects all methods.
	BackgroundColor = false
)

It contains configuration of logger.

Functions

func Debug

func Debug(format string, a ...interface{})

Debug formats according to a format specifier and writes to standard output.

func Error

func Error(format string, a ...interface{})

Error formats according to a format specifier and writes to standard output.

func Fatal

func Fatal(format string, a ...interface{})

Fatal formats according to a format specifier and writes to standard output.

func Info

func Info(format string, a ...interface{})

Info formats according to a format specifier and writes to standard output.

func InitAndCloseOther

func InitAndCloseOther()

InitLogger initializes the logger

func Success

func Success(format string, a ...interface{})

Success formats according to a format specifier and writes to standard output.

func Warning

func Warning(format string, a ...interface{})

Warning formats according to a format specifier and writes to standard output.

Types

type CompatLogger

type CompatLogger struct {
	PrefixLevel  int
	Level        int
	FilelineFlag bool
}

func (*CompatLogger) Debugf

func (l *CompatLogger) Debugf(format string, a ...interface{})

Debug formats according to a format specifier and writes to standard output.

func (*CompatLogger) Errorf

func (l *CompatLogger) Errorf(format string, a ...interface{})

Error formats according to a format specifier and writes to standard output.

func (*CompatLogger) Fatalf

func (l *CompatLogger) Fatalf(format string, a ...interface{})

Fatal formats according to a format specifier and writes to standard output.

func (*CompatLogger) Infof

func (l *CompatLogger) Infof(format string, a ...interface{})

func (*CompatLogger) Successf

func (l *CompatLogger) Successf(format string, a ...interface{})

Success formats according to a format specifier and writes to standard output.

func (*CompatLogger) Warningf

func (l *CompatLogger) Warningf(format string, a ...interface{})

Warning formats according to a format specifier and writes to standard output.

Jump to

Keyboard shortcuts

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