core

package
v0.0.0-...-78bd684 Latest Latest
Warning

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

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

Documentation

Overview

Copyright (c) 2020 Higker Open Source: MIT License Author: higker <deen.job@qq.com>

Copyright (c) 2020 Higker Open Source: MIT License Author: higker <deen.job@qq.com>

Copyright (c) 2020 Higker Open Source: MIT License Author: higker <https://github.com/higker>

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Console

type Console struct {
	LogLevel level.Level //log level
}

Console logger struct

func (Console) DeBug

func (c Console) DeBug(msg string, a ...interface{})

func (Console) Error

func (c Console) Error(msg string, a ...interface{})

func (Console) Info

func (c Console) Info(msg string, a ...interface{})

type FileLog

type FileLog struct {
	LogLevel     level.Level
	FileName     string
	FilePath     string
	MaxSize      int64
	ErrorFile    *os.File
	CurrencyFile *os.File
}

file log struct

func (*FileLog) DeBug

func (f *FileLog) DeBug(msg string, a ...interface{})

func (*FileLog) Error

func (f *FileLog) Error(msg string, a ...interface{})

func (*FileLog) Info

func (f *FileLog) Info(msg string, a ...interface{})

func (*FileLog) InitFile

func (f *FileLog) InitFile()

这里注意必须是指针 不源改的是内存中的副本

func (*FileLog) NewCurrFile

func (f *FileLog) NewCurrFile() *os.File

open currency log file writer

func (*FileLog) NewErrorFile

func (f *FileLog) NewErrorFile() *os.File

open error log file writer

type Logger

type Logger interface {
	Info(msg string, a ...interface{})
	Error(msg string, a ...interface{})
	DeBug(msg string, a ...interface{})
}

Goger logger of abstract interface

func NewClog

func NewClog(level level.Level) Logger

zh_cn: 返回一个 console logger english: ret of console logger

func NewFlog

func NewFlog(level level.Level, fileSize int64, savePath, filename string) Logger

Jump to

Keyboard shortcuts

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