zlog

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2021 License: Apache-2.0 Imports: 10 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.

Index

Constants

This section is empty.

Variables

View Source
var Logger *zap.Logger

Functions

func NewZapLogger

func NewZapLogger(cfg *config.CfgFile) (err error)

初始化日志 logger

Types

type GormLogger added in v1.0.1

type GormLogger struct {
	ZapLogger        *zap.Logger
	LogLevel         gormLogger.LogLevel
	SlowThreshold    time.Duration
	SkipCallerLookup bool
	Colorful         bool
}

func NewGormLogger added in v1.0.1

func NewGormLogger(zapLogger *zap.Logger, slowThreshold time.Duration) GormLogger

func (GormLogger) Error added in v1.0.1

func (l GormLogger) Error(ctx context.Context, str string, args ...interface{})

func (GormLogger) Info added in v1.0.1

func (l GormLogger) Info(ctx context.Context, str string, args ...interface{})

func (GormLogger) LogMode added in v1.0.1

func (GormLogger) SetAsDefault added in v1.0.1

func (l GormLogger) SetAsDefault()

func (GormLogger) Trace added in v1.0.1

func (l GormLogger) Trace(ctx context.Context, begin time.Time, fc func() (string, int64), err error)

func (GormLogger) Warn added in v1.0.1

func (l GormLogger) Warn(ctx context.Context, str string, args ...interface{})

Jump to

Keyboard shortcuts

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