loger

package
v0.3.3 Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2022 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

* @Author: LinkLeong link@icewhale.com * @Date: 2022-06-02 15:09:38 * @LastEditors: LinkLeong * @LastEditTime: 2022-06-27 15:47:49 * @FilePath: /CasaOS/pkg/utils/loger/log.go * @Description: * @Website: https://www.casaos.io * Copyright (c) 2022 by icewhale, All Rights Reserved.

Index

Constants

This section is empty.

Variables

View Source
var (
	F                  *os.File
	DefaultPrefix      = ""
	DefaultCallerDepth = 2
)

Functions

func Debug added in v0.3.2

func Debug(message string, fields ...zap.Field)

func Error added in v0.3.2

func Error(message string, fields ...zap.Field)

func Info added in v0.3.2

func Info(message string, fields ...zap.Field)

func LogInit added in v0.3.2

func LogInit()

func LogSetupOld added in v0.3.2

func LogSetupOld()

日志初始化

func Warn added in v0.3.2

func Warn(message string, fields ...zap.Field)

Types

type Level

type Level int

定义一个int的别名

const (
	DEBUG Level = iota
	INFO
	WARN
	ERROR
	FATAL
)

iota在const关键字出现时将被重置为0(const内部的第一行之前),const中每新增一行常量声明将使iota计数一次(iota可理解为const语句块中的行索引)。

type OLog

type OLog interface {
	Debug(v ...interface{})
	Info(v ...interface{})
	Warn(v ...interface{})
	Error(v ...interface{})
	Fatal(v ...interface{})
	Path() string
}

func NewOLoger

func NewOLoger() OLog

Jump to

Keyboard shortcuts

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