context

package
v0.0.0-...-3c5032a Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2017 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APIConfig

type APIConfig struct {
	LogConfig *LogConfig
}

APIConfig represents the API configuration

func GetAPIConfig

func GetAPIConfig() *APIConfig

GetAPIConfig return the instance of the APIConfig

type APILog

type APILog struct {
	// contains filtered or unexported fields
}

APILog is the API logger

func NewAPILog

func NewAPILog() *APILog

NewAPILog returns a pointer of the APILog

func (APILog) Debug

func (l APILog) Debug(class, method, requestID, ip, action, result, message string)

Debug write a debug log level

func (APILog) Error

func (l APILog) Error(class, method, requestID, ip, action, result, message string)

Error write a error log level

func (APILog) Info

func (l APILog) Info(class, method, requestID, ip, action, result, message string)

Info write a info log level

func (APILog) Warn

func (l APILog) Warn(class, method, requestID, ip, action, result, message string)

Warn write a warning log level

type LogConfig

type LogConfig struct {
	LogLevel    string
	LogToFile   bool
	LogFileName string
}

LogConfig represents the log configuration

type Logger

type Logger interface {
	// Debug write a debug log level
	Debug(class, method, requestID, ip, action, result, message string)

	// Info write a info log level
	Info(class, method, requestID, ip, action, result, message string)

	// Warn write a warning log level
	Warn(class, method, requestID, ip, action, result, message string)

	// Error write a error log level
	Error(class, method, requestID, ip, action, result, message string)
}

Logger is a interface to log object

func GetLogger

func GetLogger() Logger

GetLogger return a new instance of the log

Jump to

Keyboard shortcuts

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