Documentation
¶
Overview ¶
Package ilog provides a simple and lightweight logging framework for involucro. It is a Go-lang-y abbreviation for involucro logging.
All public methods in this package are thread-safe.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // Debug is a level not printed by default with prefix "DEBU". Debug = ForLevelPrefix(-2, "DEBU") // Info is a level not printed by default with prefix "INFO". Info = ForLevelPrefix(-1, "INFO") // Warn is a level printed by default with prefix "WARN". Warn = ForLevelPrefix(0, "WARN") // Error is a level printed by default with prefix "ERRO". Error = ForLevelPrefix(1, "ERRO") )
var StdLog = New()
StdLog is the default logger that is available in the global space.
Functions ¶
Types ¶
type Bough ¶
A Bough is an entry in a log.
type Ilog ¶
type Ilog struct {
// contains filtered or unexported fields
}
Ilog is the context for all loggers. There is a default instance which is sufficient for most use cases.
func (*Ilog) ForLevelPrefix ¶
ForLevelPrefix gives a logger for level l and prefix p.
func (*Ilog) MinPrintLevel ¶
MinPrintLevel returns the minimum required print level.
func (*Ilog) PrintFunc ¶
PrintFunc gives the function currently used for printing.
func (*Ilog) Send ¶
Send handles a Bough and delivers it to the print function if the level of the bough is at least the minimum print level.
func (*Ilog) SetMinPrintLevel ¶
SetMinPrintLevel sets the minimum required level for a Bough to be actually printed. Level 2 messages are only printed if the level is 2 or lower.
Source Files
¶
- ilog.go