Standard library / log

log.Logger.SetFlags()

Replace the formatting bitmask. Expected stdout: 'hello\n'.

Formal Syntax & Structure

go syntaxgo
func (l *Logger) SetFlags(flag int)

Parameters & Attributes

NameTypeDescription
flagintBitmask of formatting flags.

Working Example

Example Snippetgo
package main
import (  "bytes"  "fmt"  "log")
func main() {  var b bytes.Buffer  l := log.New(&b, "", 0)  l.SetFlags(0)  l.Print("hello")  fmt.Print(b.String())}
Go Reference