log

package module
v1.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 22, 2018 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package log provides functions for pretty print

Patterns of functions print:

  • Print(), Printf(), Println(): (?time) msg
  • Info(), Infof(), Infoln(): (?time) [INFO] msg
  • Error(), Errorf(), Errorln(): (?time) [ERR] (?file:line) error
  • Fatal(), Fatalf(), Fatalln(): (?time) [FATAL] (?file:line) error

Time pattern: MM.dd.yyyy hh:mm:ss (01.30.2018 05:5:59)

Index

Constants

This section is empty.

Variables

View Source
var ShowTime = PrintTime

ShowTime sets printTime Time isn't printed by default

It was left for backwards compatibility

Functions

func Error

func Error(v ...interface{})

Error prints error Output pattern: (?time) [ERR] (?file:line) error

func Errorf

func Errorf(format string, v ...interface{})

Errorf prints error Output pattern: (?time) [ERR] (?file:line) error

func Errorln

func Errorln(v ...interface{})

Errorln prints error Output pattern: (?time) [ERR] (?file:line) error

func Fatal

func Fatal(v ...interface{})

func Fatalf

func Fatalf(format string, v ...interface{})

func Fatalln

func Fatalln(v ...interface{})

func Info

func Info(v ...interface{})

func Infof

func Infof(format string, v ...interface{})

func Infoln

func Infoln(v ...interface{})

func Print

func Print(v ...interface{})

func PrintColor

func PrintColor(b bool)

PrintColor sets printColor printColor is true by default

func PrintErrorLine added in v1.1.0

func PrintErrorLine(b bool)

PrintErrorLine sets PrintErrorLine If PrintErrorLine is true, log.Error(), log.Errorf(), log.Errorln() will print file and line, where functions were called. PrintErrorLine is true by default

func PrintTime added in v1.2.0

func PrintTime(b bool)

PrintTime sets printTime Time isn't printed by default

func Printf

func Printf(format string, v ...interface{})

func Println

func Println(v ...interface{})

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL