log

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Copyright (c) Microsoft Corporation. Licensed under the MIT license.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EncoderConfig

func EncoderConfig() zapcore.EncoderConfig

func SetupZapLogger

func SetupZapLogger(lOpts *LogOpts)

Types

type LogOpts

type LogOpts struct {
	Level                 string
	File                  bool
	FileName              string
	MaxFileSizeMB         int
	MaxBackups            int
	MaxAgeDays            int
	ApplicationInsightsID string
	EnableTelemetry       bool
}

func GetDefaultLogOpts

func GetDefaultLogOpts() *LogOpts

type ZapLogger

type ZapLogger struct {
	*zap.Logger
	// contains filtered or unexported fields
}

func Logger

func Logger() *ZapLogger

func (*ZapLogger) AddFields

func (l *ZapLogger) AddFields(fields ...zap.Field)

AddFields adds custom fields to the logger

func (*ZapLogger) Close

func (l *ZapLogger) Close()

func (*ZapLogger) GetZappedMiddleware

func (l *ZapLogger) GetZappedMiddleware() func(next http.Handler) http.Handler

func (*ZapLogger) Level

func (l *ZapLogger) Level() int

func (*ZapLogger) Named

func (l *ZapLogger) Named(name string) *ZapLogger

func (*ZapLogger) SetLevel

func (l *ZapLogger) SetLevel(lvl string)

Jump to

Keyboard shortcuts

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