types

package
v0.0.27 Latest Latest
Warning

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

Go to latest
Published: Dec 26, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MAX = 6
)

Some Constants

Variables

View Source
var (
	FuncMaintenanceType = LogType{/* contains filtered or unexported fields */}
	DebugType           = LogType{/* contains filtered or unexported fields */}
	NilObject           = LogType{/* contains filtered or unexported fields */}
)

Functions

This section is empty.

Types

type LogLevel

type LogLevel int

LogLevel Object

const (
	DEBUG LogLevel = MAX - iota
	INFO
	WARNING
	ERROR
)

Some Constants - used with LogLevel

func StringToLogLevel

func StringToLogLevel(level string) LogLevel

func (LogLevel) IsLogLevel

func (l LogLevel) IsLogLevel() bool

IsLogLevel - check whether is a true log level

func (LogLevel) String

func (l LogLevel) String() string

type LogObject

type LogObject struct {
	Level      LogLevel
	Module     string
	LogType    string
	Time       int64
	Additional interface{}
	Message    interface{}
}

LogObject - all methods that want to log must transfer object of this.

func NewLogObject

func NewLogObject(level LogLevel, module string, logType LogType, eventTime time.Time, message interface{}, additional interface{}) *LogObject

NewLogObject - enhance method to create and return reference of LogObject

type LogType

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

LogType Object

func NewLogType

func NewLogType(name string) LogType

NewLogType - Create A New Log Type

func (LogType) String

func (l LogType) String() string

type Logger

type Logger interface {
	Constructor(name string) error
	Close()
	Log(obj *LogObject)
	IsInitialized() bool
	Sync()
}

Logger interface

type ZhycanLog

type ZhycanLog struct {
	gorm.Model

	ServiceName string `gorm:"not null;size:256" json:"service_name"`
	Level       string `gorm:"size:64" json:"level"`
	LogType     string `gorm:"size:256" json:"log_type"`
	Module      string `gorm:"size:1024" json:"module"`
	Message     string `json:"message"`
	Additional  string `json:"additional"`
	LogTime     int64  `json:"logTime"`
}

Jump to

Keyboard shortcuts

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