types

package
v0.0.13 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2024 License: GPL-3.0 Imports: 0 Imported by: 0

Documentation

Overview

Package logtor provides constants and utility functions related to logging, including LogLevel constants, LogCreatorName type, color codes for different log levels, and functions for color formatting and checking whether a log level is acceptable based on a selected level.

Variables:

  • ResetColor: ANSI escape code to reset color.
  • NoneColor, FatalColor, ErrorColor, WarnColor, DebugColor, InfoColor, TraceColor: ANSI escape codes for log level colors.

Constants: - LogLevel: Represents different log levels (NONE, FATAL, ERROR, WARN, DEBUG, INFO, TRACE). - LogCreatorName: Represents the names of log creators. - Color Codes: ANSI escape codes for log level colors.

Functions: - GetColorForLogLevel: Returns the ANSI escape code for the color associated with a log level. - IsLogLevelAcceptable: Checks if a given log level is acceptable based on the selected log level.

Index

Constants

This section is empty.

Variables

View Source
var (
	ResetColor = "\033[0m"
	NoneColor  = "\033[97m"
	FatalColor = "\033[31m"
	ErrorColor = "\033[31m"
	WarnColor  = "\033[33m"
	DebugColor = "\033[32m"
	InfoColor  = "\033[34m"
	TraceColor = "\033[35m"
)
View Source
var LogLevelList = []LogLevel{NONE, FATAL, ERROR, WARN, DEBUG, INFO, TRACE}

Functions

func GetColorForLogLevel

func GetColorForLogLevel(level LogLevel) string

func IsLogLevelAcceptable

func IsLogLevelAcceptable(selected, using LogLevel) bool

Types

type LogCreatorName

type LogCreatorName string

type LogLevel

type LogLevel string
const (
	NONE  LogLevel = "NONE"
	FATAL LogLevel = "FATAL"
	ERROR LogLevel = "ERROR"
	WARN  LogLevel = "WARN"
	DEBUG LogLevel = "DEBUG"
	INFO  LogLevel = "INFO"
	TRACE LogLevel = "TRACE"
)

Jump to

Keyboard shortcuts

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