util

package
v0.0.0-...-5283a38 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2020 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func TimeTrack

func TimeTrack(start time.Time, name string)

TimeTrack prints the execution time of a specific function.

Example:

func myFunction() int {
   defer timeTrack(time.Now(), "myFunction")
   // ... do some things, maybe even return under some condition
   return result
}

Types

type Log

type Log struct {
	Context string
}

Log provides logging methods. Provide the given context (file or package name for example) to be displayed in the log messages.

func (*Log) E

func (l *Log) E(method string, err error)

E logs given error.

func (*Log) W

func (l *Log) W(method string, msg string)

W logs given message.

Jump to

Keyboard shortcuts

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