utils

package
v0.0.0-...-f8ea196 Latest Latest
Warning

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

Go to latest
Published: Jan 3, 2020 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// Trace is a log handler for extremely detailed level logs. It is so far
	// sparely used in scipipe.
	Trace *log.Logger
	// Debug is a log handler for debugging level logs
	Debug *log.Logger
	// Info is a log handler for information level logs
	Info *log.Logger
	// Audit is a log handler for audit level logs
	Audit *log.Logger
	// Warning is a log handler for warning level logs
	Warning *log.Logger
	// Error is a log handler for error level logs
	Error *log.Logger
)

Functions

func Decode

func Decode(s string) (int64, error)

Decode return a integer of a base62 encoded string.

func Encode

func Encode(num int64) string

Encode return a base representation as string of the given integer number.

func GetMysqlConnectingString

func GetMysqlConnectingString() string

func GetRedisOption

func GetRedisOption() redis.Options

func InitConfig

func InitConfig()

func InitLog

func InitLog(
	traceHandle io.Writer,
	debugHandle io.Writer,
	infoHandle io.Writer,
	auditHandle io.Writer,
	warningHandle io.Writer,
	errorHandle io.Writer)

InitLog initiates logging handlers

func InitLogAudit

func InitLogAudit()

InitLogAudit initiate logging with level=AUDIT

func InitLogAuditToFile

func InitLogAuditToFile(filePath string)

InitLogAuditToFile initiate logging with level=AUDIT, and write that to fileName

func InitLogDebug

func InitLogDebug()

InitLogDebug initiates logging with level=DEBUG

func InitLogError

func InitLogError()

InitLogError initiates logging with level=ERROR

func InitLogInfo

func InitLogInfo()

InitLogInfo initiates logging with level=INFO

func InitLogWarning

func InitLogWarning()

InitLogWarning initiates logging with level=WARNING

func LogAuditf

func LogAuditf(componentName string, message string, values ...interface{})

LogAuditf logs a pretty printed log message with the AUDIT log level, where componentName is a name of a process, task, workflow or similar that generates the message, while message and values are formatted in the manner of fmt.Printf

func LogAuditln

func LogAuditln(componentName string, message string)

LogAuditln logs a pretty printed log message with the AUDIT log level, where componentName is a name of a process, task, workflow or similar that generates the message, while message is a custom message (can be specified as multiple strings, which will then be formatted in the manner of fmt.Println).

Types

This section is empty.

Jump to

Keyboard shortcuts

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