README 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. glog
  2. ====
  3. Leveled execution logs for Go.
  4. This is an efficient pure Go implementation of leveled logs in the
  5. manner of the open source C++ package
  6. http://code.google.com/p/google-glog
  7. By binding methods to booleans it is possible to use the log package
  8. without paying the expense of evaluating the arguments to the log.
  9. Through the -vmodule flag, the package also provides fine-grained
  10. control over logging at the file level.
  11. The comment from glog.go introduces the ideas:
  12. Package glog implements logging analogous to the Google-internal
  13. C++ INFO/ERROR/V setup. It provides functions Info, Warning,
  14. Error, Fatal, plus formatting variants such as Infof. It
  15. also provides V-style logging controlled by the -v and
  16. -vmodule=file=2 flags.
  17. Basic examples:
  18. glog.Info("Prepare to repel boarders")
  19. glog.Fatalf("Initialization failed: %s", err)
  20. See the documentation for the V function for an explanation
  21. of these examples:
  22. if glog.V(2) {
  23. glog.Info("Starting transaction...")
  24. }
  25. glog.V(2).Infoln("Processed", nItems, "elements")
  26. The repository contains an open source version of the log package
  27. used inside Google. The master copy of the source lives inside
  28. Google, not here. The code in this repo is for export only and is not itself
  29. under development. Feature requests will be ignored.
  30. Send bug reports to golang-nuts@googlegroups.com.