Home / File/ log.go — fiber Source File

log.go — fiber Source File

Architecture documentation for log.go, a go file in the fiber codebase. 1 imports, 0 dependents.

File go 1 imports 2 classes

Entity Profile

Dependency Diagram

graph LR
  05d2e69f_2f9c_91ef_77c4_ba99b4116598["log.go"]
  cc7104af_aece_1fe5_3985_791c7f34910c["context"]
  05d2e69f_2f9c_91ef_77c4_ba99b4116598 --> cc7104af_aece_1fe5_3985_791c7f34910c
  style 05d2e69f_2f9c_91ef_77c4_ba99b4116598 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

package log

import (
	"context"
	"fmt"
	"io"
	"log"
	"os"
)

// baseLogger defines the minimal logger functionality required by the package.
// It allows storing any logger implementation regardless of its generic type.
type baseLogger interface {
	CommonLogger
	SetLevel(Level)
	SetOutput(io.Writer)
	WithContext(ctx context.Context) CommonLogger
}

var logger baseLogger = &defaultLogger{
	stdlog: log.New(os.Stderr, "", log.LstdFlags|log.Lshortfile|log.Lmicroseconds),
	depth:  4,
}

// Logger is a logger interface that provides logging function with levels.
type Logger interface {
	Trace(v ...any)
	Debug(v ...any)
	Info(v ...any)
	Warn(v ...any)
	Error(v ...any)
	Fatal(v ...any)
	Panic(v ...any)
}

// FormatLogger is a logger interface that output logs with a format.
type FormatLogger interface {
	Tracef(format string, v ...any)
	Debugf(format string, v ...any)
	Infof(format string, v ...any)
	Warnf(format string, v ...any)
	Errorf(format string, v ...any)
	Fatalf(format string, v ...any)
	Panicf(format string, v ...any)
}

// WithLogger is a logger interface that output logs with a message and key-value pairs.
type WithLogger interface {
	Tracew(msg string, keysAndValues ...any)
	Debugw(msg string, keysAndValues ...any)
	Infow(msg string, keysAndValues ...any)
	Warnw(msg string, keysAndValues ...any)
	Errorw(msg string, keysAndValues ...any)
	Fatalw(msg string, keysAndValues ...any)
	Panicw(msg string, keysAndValues ...any)
}

// CommonLogger is the set of logging operations available across Fiber's
// logging implementations.
type CommonLogger interface {
// ... (62 more lines)

Classes

Dependencies

  • context

Frequently Asked Questions

What does log.go do?
log.go is a source file in the fiber codebase, written in go.
What does log.go depend on?
log.go imports 1 module(s): context.
Where is log.go in the architecture?
log.go is located at log/log.go (directory: log).

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free