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.
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.
Index ¶
- Variables
- func NewZapLogger(cfg *config.CfgFile) (err error)
- type GormLogger
- func (l GormLogger) Error(ctx context.Context, str string, args ...interface{})
- func (l GormLogger) Info(ctx context.Context, str string, args ...interface{})
- func (l GormLogger) LogMode(level gormLogger.LogLevel) gormLogger.Interface
- func (l GormLogger) SetAsDefault()
- func (l GormLogger) Trace(ctx context.Context, begin time.Time, fc func() (string, int64), err error)
- func (l GormLogger) Warn(ctx context.Context, str string, args ...interface{})
Constants ¶
This section is empty.
Variables ¶
var Logger *zap.Logger
Functions ¶
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 (l GormLogger) LogMode(level gormLogger.LogLevel) gormLogger.Interface
func (GormLogger) SetAsDefault ¶ added in v1.0.1
func (l GormLogger) SetAsDefault()