Go Package log: Difference between revisions
Jump to navigation
Jump to search
Line 6: | Line 6: | ||
* [[Go Concepts - Standard Library#Packages|Standard Library]] | * [[Go Concepts - Standard Library#Packages|Standard Library]] | ||
=Overview= | |||
The "log" package provides support for logging messages to <tt>stdout</tt>, <tt>stderr</tt> or custom devices. | |||
=Recipes= | =Recipes= |
Revision as of 18:29, 2 April 2016
External
Internal
Overview
The "log" package provides support for logging messages to stdout, stderr or custom devices.
Recipes
Changing the Logging Device
By default, the logger is set to write to stderr. To change that:
import ( "log" "os" ) ... func init() { // change the device for logging to stdout log.SetOutput(os.Stdout) }