logger

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package logger provides structured logging for Nebula

Index

Constants

View Source
const (
	// RequestIDKey is the context key for request ID
	RequestIDKey contextKey = "request_id"
	// ConnectorKey is the context key for connector name
	ConnectorKey contextKey = "connector"
	// JobIDKey is the context key for job ID
	JobIDKey contextKey = "job_id"
)

Variables

This section is empty.

Functions

func Debug

func Debug(msg string, fields ...zap.Field)

Debug logs a debug message

func Error

func Error(msg string, fields ...zap.Field)

Error logs an error message

func Fatal

func Fatal(msg string, fields ...zap.Field)

Fatal logs a fatal message and exits

func Get

func Get() *zap.Logger

Get returns the global logger

func Info

func Info(msg string, fields ...zap.Field)

Info logs an info message

func Init

func Init(cfg Config) error

Init initializes the global logger

func Sync

func Sync() error

Sync flushes any buffered log entries

func Warn

func Warn(msg string, fields ...zap.Field)

Warn logs a warning message

func With

func With(fields ...zap.Field) *zap.Logger

With creates a child logger with additional fields

func WithContext

func WithContext(ctx context.Context) *zap.Logger

WithContext returns a logger with context values

Types

type Config

type Config struct {
	Level       string
	Development bool
	Encoding    string // json or console
	OutputPaths []string
}

Config represents logger configuration

Jump to

Keyboard shortcuts

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