Documentation ¶
Index ¶
- Variables
- func AdditionalComponentCallerEncoder(caller zapcore.EntryCaller, enc zapcore.PrimitiveArrayEncoder)
- func DefaultLoggerConfig(level zapcore.Level) zp.Config
- func DummyLoggerFactory(ctx context.Context) log.Logger
- func ExtractYTLogger(lgr log.Logger) log.Logger
- func LogLevel() string
- func LoggerWithLevel(lvl zapcore.Level) log.Logger
- func NewConsoleLogger() log.Logger
- func NewKafkaLogger(cfg *KafkaConfig) (*zap.Logger, io.Closer, error)
- func NewMutableRegistry(registry metrics.Registry) metrics.Registry
- type Factory
- type JSONTruncator
- type JSONTruncatorConfig
- type KafkaConfig
- type LeakyWriter
- type LogLevelSetter
- type Writer
- type YtLogBundle
Constants ¶
This section is empty.
Variables ¶
View Source
var Log log.Logger
Дефолтный логгер. В ыте будет консольный. В nanny будет json-ый. В дев тачке будет прекрасный.
View Source
var NullLog *zap.Logger
Functions ¶
func AdditionalComponentCallerEncoder ¶
func AdditionalComponentCallerEncoder(caller zapcore.EntryCaller, enc zapcore.PrimitiveArrayEncoder)
func ExtractYTLogger ¶
ExtractYTLogger is a helper function to extract YT log. If the `lgr` parameter is not of thge type logger.YtLogBundle, then the log returned itself, otherwise log for YT is returned
func NewConsoleLogger ¶
func NewKafkaLogger ¶
Types ¶
type JSONTruncator ¶
type JSONTruncator struct {
// contains filtered or unexported fields
}
func NewJSONTruncator ¶
func NewJSONTruncator( writer io.Writer, logger log.Logger, config JSONTruncatorConfig, registry metrics.Registry, ) *JSONTruncator
type JSONTruncatorConfig ¶
type KafkaConfig ¶
type LeakyWriter ¶
type LeakyWriter struct {
// contains filtered or unexported fields
}
func NewLeakyWriter ¶
func NewLeakyWriter(writer Writer, registry metrics.Registry, maxSize int) *LeakyWriter
type LogLevelSetter ¶
type LogLevelSetter struct {
LogLevel string `yaml:"log_level"`
}
type YtLogBundle ¶
type YtLogBundle interface { log.Logger // ExtractYTLogger extracts YT logger with different settings but all registered "with" values applied to main worker ExtractYTLogger() log.Logger }
YtLogBundle is a logger that holds reference to YT Logger in order to hook all "with's" modification and apply them syncrhonously. You may override other hooks.
func NewYtLogBundle ¶
func NewYtLogBundle(log, ytLogger log.Logger) YtLogBundle
NewYtLogBundle constructs LogBundle from two loggers: original one and separate logger for YT. Acts like standard zap.Must(config), but hooks system log calls "With" to apply to zap.Must(ytConfig)
Click to show internal directories.
Click to hide internal directories.