Go Package log: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
No edit summary
Line 6: Line 6:


* [[Go Concepts - Standard Library#Packages|Go Standard Library]]
* [[Go Concepts - Standard Library#Packages|Go Standard Library]]
=Recipes=
==Changing the Logging Device==
<pre>
import (
    "log"
    "os"
)
...
func init() {
    // change the device for logging to stdout
    log.SetOutput(os.Stdout)
}
</pre>

Revision as of 16:59, 2 April 2016

External

Internal

Recipes

Changing the Logging Device

import (
    "log"
    "os"
)
...
func init() {

    // change the device for logging to stdout
    log.SetOutput(os.Stdout)
}