Skip to content
This repository has been archived by the owner on Jul 28, 2020. It is now read-only.

zhevron/log

Repository files navigation

log - Simple logging library

wercker status Coverage Status GoDoc

log is a simple logging library for Google Go.
For full package documentation, see the GoDoc link above.

Usage

Log to file

// Create and open a file.
f, err := os.Create("myLogFile.log")
if err != nil {
  panic(err)
}
defer f.Close()

// Add the file as an output.
log.AddOutput(f)

// Create a new logger.
logger := log.NewLogger("MyLogger", log.Info)

logger.Info("This message will appear in the log file")

Log to stdout

// Add stdout as an output.
log.AddOutput(os.Stdout)

// Create a new logger.
logger := log.NewLogger("MyLogger", log.Info)

logger.Info("This message will appear in stdout")

License

log is licensed under the MIT license.

Releases

No releases published

Packages

No packages published

Languages