Skip to content

better0332/vlog

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 

Repository files navigation

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

About

Leveled log on std log for Go

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages