Documentation ¶
Overview ¶
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to You 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 to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to You 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 to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to You 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 to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to You 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 ¶
- func Debug(args ...interface{})
- func Debugf(template string, args ...interface{})
- func Debugw(message string, fields ...zapcore.Field)
- func Error(args ...interface{})
- func Errorf(template string, args ...interface{})
- func Errorw(message string, fields ...zapcore.Field)
- func Fatal(args ...interface{})
- func Fatalf(template string, args ...interface{})
- func Fatalw(message string, fields ...zapcore.Field)
- func GinLogger() gin.HandlerFunc
- func GinRecovery(stack bool) gin.HandlerFunc
- func Info(args ...interface{})
- func Infof(template string, args ...interface{})
- func Infow(message string, fields ...zapcore.Field)
- func Level() zapcore.Level
- func Panic(args ...interface{})
- func Panicf(template string, args ...interface{})
- func Panicw(message string, fields ...zapcore.Field)
- func Warn(args ...interface{})
- func Warnf(template string, args ...interface{})
- func Warnw(message string, fields ...zapcore.Field)
- type Logger
- func (logger *Logger) Close() (err error)
- func (logger *Logger) Debug(args ...interface{})
- func (logger *Logger) Debugf(template string, args ...interface{})
- func (logger *Logger) Debugw(message string, fields ...zapcore.Field)
- func (logger *Logger) Error(args ...interface{})
- func (logger *Logger) Errorf(template string, args ...interface{})
- func (logger *Logger) Errorw(message string, fields ...zapcore.Field)
- func (logger *Logger) Fatal(args ...interface{})
- func (logger *Logger) Fatalf(template string, args ...interface{})
- func (logger *Logger) Fatalw(message string, fields ...zapcore.Field)
- func (logger *Logger) Info(args ...interface{})
- func (logger *Logger) Infof(template string, args ...interface{})
- func (logger *Logger) Infow(message string, fields ...zapcore.Field)
- func (logger *Logger) Level() zapcore.Level
- func (logger *Logger) Panic(args ...interface{})
- func (logger *Logger) Panicf(template string, args ...interface{})
- func (logger *Logger) Panicw(message string, fields ...zapcore.Field)
- func (logger *Logger) Sync() (err error)
- func (logger *Logger) Warn(args ...interface{})
- func (logger *Logger) Warnf(template string, args ...interface{})
- func (logger *Logger) Warnw(message string, fields ...zapcore.Field)
- type Option
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Debug ¶
func Debug(args ...interface{})
Debug uses the fmt.Sprint to construct and log a message using the DefaultLogger.
func Debugf ¶
func Debugf(template string, args ...interface{})
Debugf uses the fmt.Sprintf to log a templated message using the DefaultLogger.
func Error ¶
func Error(args ...interface{})
Error uses the fmt.Sprint to construct and log a message using the DefaultLogger.
func Errorf ¶
func Errorf(template string, args ...interface{})
Errorf uses the fmt.Sprintf to log a templated message using the DefaultLogger.
func Fatal ¶
func Fatal(args ...interface{})
Fatal uses the fmt.Sprint to construct and log a message using the DefaultLogger.
func Fatalf ¶
func Fatalf(template string, args ...interface{})
Fatalf uses the fmt.Sprintf to log a templated message using the DefaultLogger.
func GinLogger ¶ added in v1.7.0
func GinLogger() gin.HandlerFunc
GinLogger receive gin The default log of the framework
func GinRecovery ¶ added in v1.7.0
func GinRecovery(stack bool) gin.HandlerFunc
GinRecovery recover Drop the project that may appear panic
func Info ¶
func Info(args ...interface{})
Info uses the fmt.Sprint to construct and log a message using the DefaultLogger.
func Infof ¶
func Infof(template string, args ...interface{})
Infof uses the fmt.Sprintf to log a templated message using the DefaultLogger.
func Panic ¶
func Panic(args ...interface{})
Panic uses the fmt.Sprint to construct and log a message using the DefaultLogger.
func Panicf ¶
func Panicf(template string, args ...interface{})
Panicf uses the fmt.Sprintf to log a templated message using the DefaultLogger.
func Warn ¶
func Warn(args ...interface{})
Warn uses the fmt.Sprint to construct and log a message using the DefaultLogger.
Types ¶
type Logger ¶
type Logger struct {
// contains filtered or unexported fields
}
Logger is a log object, which exposes standard APIs like errorf, error, warn, warnf and etcd.
var ( // DefaultLogger is the default logger, which logs message to stderr and with // the minimal level "warn". DefaultLogger *Logger )
func (*Logger) Debug ¶
func (logger *Logger) Debug(args ...interface{})
Debug uses the fmt.Sprint to construct and log a message.
func (*Logger) Error ¶
func (logger *Logger) Error(args ...interface{})
Error uses the fmt.Sprint to construct and log a message.
func (*Logger) Fatal ¶
func (logger *Logger) Fatal(args ...interface{})
Fatal uses the fmt.Sprint to construct and log a message.
func (*Logger) Info ¶
func (logger *Logger) Info(args ...interface{})
Info uses the fmt.Sprint to construct and log a message.
func (*Logger) Panic ¶
func (logger *Logger) Panic(args ...interface{})
Panic uses the fmt.Sprint to construct and log a message.
func (*Logger) Warn ¶
func (logger *Logger) Warn(args ...interface{})
Warn uses the fmt.Sprint to construct and log a message.
type Option ¶
type Option interface {
// contains filtered or unexported methods
}
Option configures how to set up logger.
func WithOutputFile ¶
WithOutputFile sets the output file path.
func WithWriteSyncer ¶
func WithWriteSyncer(ws zapcore.WriteSyncer) Option
WithWriteSyncer is a low level API which sets the underlying WriteSyncer by providing a zapcore.WriterSyncer, which has high priority than WithOutputFile.