logger

package
v0.0.18 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Copyright © 2020 Marvin

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

View Source
const (
	LogTimeFmt = "2006-01-02 15:04:05.000"
)

Variables

This section is empty.

Functions

func DPanic

func DPanic(msg string, fields ...zap.Field)

func Debug

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

func Error

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

func Fatal

func Fatal(msg string, fields ...zap.Field)

func GetGormLogger

func GetGormLogger(logLevel string, slowThreshold uint64) zapgorm2.Logger

func GetRootLogger

func GetRootLogger() *zap.Logger

func Info

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

func NewCronLogger

func NewCronLogger(l *zap.Logger) cron.Logger

func NewRootLogger

func NewRootLogger(cfg *Config)

func Panic

func Panic(msg string, fields ...zap.Field)

func Sync

func Sync() error

func Warn

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

func WithField

func WithField(key string, value string)

Types

type Config

type Config struct {
	LogLevel   string `toml:"log-level" json:"log-level"`
	LogFile    string `toml:"log-file" json:"log-file"`
	MaxSize    int    `toml:"max-size" json:"max-size"`
	MaxDays    int    `toml:"max-days" json:"max-days"`
	MaxBackups int    `toml:"max-backups" json:"max-backups"`
}

type CronLogger

type CronLogger struct {
	L *zap.Logger
}

func (*CronLogger) Error

func (cl *CronLogger) Error(err error, msg string, keysAndValues ...interface{})

func (*CronLogger) Info

func (cl *CronLogger) Info(msg string, keysAndValues ...interface{})

func (*CronLogger) Printf

func (cl *CronLogger) Printf(string, ...interface{})

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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