Skip to content

Latest commit

 

History

History
29 lines (22 loc) · 797 Bytes

README.md

File metadata and controls

29 lines (22 loc) · 797 Bytes

vlog

Package vlog add leveled log on std log(golang.org/pkg/log/)

It implements most std log functions(except logger), variables and add provides V-style logging controlled by the -v flag or SetLogLevel()
If flag.Parse be called before any logging, -v flag(default 0) use automaticlly.

Basic examples:

if !vlog.IsLevelParsed() {
	vlog.SetLogLevel(3)
}
vlog.GetLogLevel()

vlog.Println("Prepare to repel boarders")

vlog.Fatalf("Initialization failed: %s", err)

See the documentation for the V function for an explanation of these examples:

if vlog.V(2) {
	vlog.Print("Starting transaction...")
}

vlog.V(2).Println("Processed", nItems, "elements")

License

vlog is available under the Apache License, Version 2.0