tlog

package
v0.0.0-...-ea67977 Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2021 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package tlog implements logging utilities for boilr

Index

Constants

View Source
const (
	// DebugMark character indicates debug message.
	DebugMark = "☹"

	// CheckMark character indicates success message.
	CheckMark = "✔"

	// InfoMark character indicates information message.
	InfoMark = "i"

	// WarnMark character indicates warning message.
	WarnMark = "!"

	// ErrorMark character indicates error message.
	ErrorMark = "✘"

	// QuestionMark character indicates prompt message.
	QuestionMark = "?"
)

TODO default to ASCII if Unicode is not supported

View Source
const (
	LevelDebug   = 1 << 5
	LevelFatal   = 1 << 4
	LevelWarn    = 1 << 3
	LevelError   = 1 << 2
	LevelInfo    = 1 << 1
	LevelSuccess = 1 << 0
)

All available error levels.

Variables

This section is empty.

Functions

func Debug

func Debug(msg string)

Debug logs the given message as a debug message.

func Error

func Error(msg string)

Error logs the given message as a error message.

func Fatal

func Fatal(msg string)

Fatal logs the given message as a fatal message.

func Info

func Info(msg string)

Info logs the given message as a info message.

func Prompt

func Prompt(msg string, defval interface{})

Prompt outputs the given message as a question along with a default value.

func SetLogLevel

func SetLogLevel(LogLevelString string)

SetLogLevel sets the global logging level.

func Success

func Success(msg string)

Success logs the given message as a success message.

func Warn

func Warn(msg string)

Warn logs the given message as a warn message.

Types

type Level

type Level uint16

Level is a 16-bit set holding the enabled log levels.

func (Level) Permits

func (lvl Level) Permits(queryLvl Level) bool

Permits queries whether the given log level is enabled or not.

func (*Level) Set

func (lvl *Level) Set(newLvl Level)

Set enables the levels upto and including the given log level.

Jump to

Keyboard shortcuts

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