codaslog

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 19, 2026 License: MIT Imports: 2 Imported by: 0

README

coda-slog - slog log adapter for Coda

Go Reference CI/CD Pipeline

https://github.com/marnixbouhuis/coda

Installation

go get github.com/marnixbouhuis/coda-slog

Quick Start

package main

import (
	"log/slog"
	"os"

	"github.com/marnixbouhuis/coda"
	codaslog "github.com/marnixbouhuis/coda-slog"
)

func main() {
	// Initialize slog logger (or use the default)
	// l := slog.Default()
	l := slog.New(slog.NewTextHandler(os.Stdout, nil))

	codaLogger := codaslog.NewLogger(l.With(slog.String("source", "coda")))
	_ = coda.NewShutdown(
		// Register logger
		coda.WithShutdownLogger(codaLogger),
	)
}

Documentation

Overview

Example
package main

import (
	"log/slog"
	"os"

	"github.com/marnixbouhuis/coda"
	codaslog "github.com/marnixbouhuis/coda-slog"
)

func main() {
	// Initialize slog logger (or use the default)
	// l := slog.Default()
	l := slog.New(slog.NewTextHandler(os.Stdout, nil))

	codaLogger := codaslog.NewLogger(l.With(slog.String("source", "coda")))
	_ = coda.NewShutdown(
		// Register logger
		coda.WithShutdownLogger(codaLogger),
	)
}

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Logger

type Logger struct {
	// contains filtered or unexported fields
}

func NewLogger

func NewLogger(l *slog.Logger) *Logger

func (*Logger) Error

func (c *Logger) Error(str string)

func (*Logger) Info

func (c *Logger) Info(str string)

Jump to

Keyboard shortcuts

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