goutil

package module
v0.0.0-...-3326c39 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2020 License: MIT Imports: 5 Imported by: 1

README

Go Util

Installation

go get -u -v gitee.com/symowl/goutil

Usage

Logger
import "gitee.com/symowl/goutil"

log := goutil.NewLogger()
log.SetProfix("PREFIX")
log.SetUTC()
log.Println("MESSAGE")
UID
import "gitee.com/symowl/goutil"

uid := goutil.GetUID()

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetUID

func GetUID() string

GetUID generates optimized UUID version 1 ID.

Types

type Logger

type Logger struct {
	Prefix string
	UTC    bool
}

Logger settings.

func NewLogger

func NewLogger() *Logger

NewLogger create a new logger.

func (*Logger) Println

func (l *Logger) Println(v interface{})

Println print log information.

func (*Logger) SetPrefix

func (l *Logger) SetPrefix(prefix string)

SetPrefix set log information prefix.

func (*Logger) SetUTC

func (l *Logger) SetUTC()

SetUTC set log time zone to UTC.

Jump to

Keyboard shortcuts

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