stdlog

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

README

CI Go Report Card GoDoc

stdlog

import "github.com/go-coldbrew/log/loggers/stdlog"

Package stdlog provides a BaseLogger implementation for golang "log" package

Example

This example shows how to use the stdlog backend. It uses Go's standard "log" package for output — simple but no structured formatting.

package main

import (
	"context"

	"github.com/go-coldbrew/log"
	"github.com/go-coldbrew/log/loggers/stdlog"
)

func main() {
	logger := stdlog.NewLogger()
	log.SetLogger(log.NewLogger(logger))

	ctx := context.Background()
	log.Info(ctx, "msg", "server started", "port", 8080)
}

Index

func NewLogger

func NewLogger(options ...loggers.Option) loggers.BaseLogger

NewLogger returns a BaseLogger impl for golang "log" package

Generated by gomarkdoc

Documentation

Overview

Package stdlog provides a BaseLogger implementation for golang "log" package

Example

This example shows how to use the stdlog backend. It uses Go's standard "log" package for output — simple but no structured formatting.

package main

import (
	"context"

	"github.com/go-coldbrew/log"
	"github.com/go-coldbrew/log/loggers/stdlog"
)

func main() {
	logger := stdlog.NewLogger()
	log.SetLogger(log.NewLogger(logger))

	ctx := context.Background()
	log.Info(ctx, "msg", "server started", "port", 8080)
}

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewLogger

func NewLogger(options ...loggers.Option) loggers.BaseLogger

NewLogger returns a BaseLogger impl for golang "log" package

Types

This section is empty.

Jump to

Keyboard shortcuts

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