alog

package
v0.1.1-0...-4026904 Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2024 License: BSD-3-Clause Imports: 7 Imported by: 0

Documentation

Overview

Package alog extends the default log package with levels and other features Program command line arguments can be used to override defaults Logging level is taken from the flag "-level=2" Format is taken from the flag "-format=3" File is taken from the flag "-logfile=stdout"

Index

Constants

View Source
const (
	//NoneLevel is used to suppress all messages
	NoneLevel = 0
	//ErrorLevel is used to show only errors
	ErrorLevel = 1
	//WarningLevel is used to show only warnings and errors
	WarningLevel = 2
	//InfoLevel is used to show Info,Warning and errors
	InfoLevel = 3
	//DebugLevel is used to show all messages
	DebugLevel = 4
	//AllLevels is just a spare value in case of more levels.
	AllLevels = 99
)

Variables

This section is empty.

Functions

func Debug

func Debug(s string, args ...interface{})

Debug is for debugging messages

func Error

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

Error is for serious errors

func Fatal

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

Fatal is used to generate exit program with fatal error

func Info

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

Info is for insignificant info

func Level

func Level() int

Level returns the current logging level

func Setup

func Setup(defaultWriter io.Writer, defaultLevel int, defaultFormat int)

Setup can be called with different default levels The levels given will be overridden by command line arguments

func Warn

func Warn(s string, args ...interface{})

Warn is for significant warnings

Types

This section is empty.

Jump to

Keyboard shortcuts

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