logging

package module
v0.0.0-...-415f787 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2026 License: Apache-2.0 Imports: 2 Imported by: 0

README

Package cloudeng.io/logging

import cloudeng.io/logging

Types

Type JSONFormatter
type JSONFormatter struct {
	// contains filtered or unexported fields
}

JSONFormatter implements a log formatter that outputs JSON formatted logs.

Functions
func NewJSONFormatter(w io.Writer, prefix, indent string) *JSONFormatter

NewJSONFormatter creates a new JSONFormatter that writes to with the specified prefix and indent.

Methods
func (js *JSONFormatter) Format(v any) error

Format formats the specified value as JSON.

func (js *JSONFormatter) Write(p []byte) (n int, err error)

Write implements the io.Writer interface and it assumes that it is called with a complete JSON object.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type JSONFormatter

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

JSONFormatter implements a log formatter that outputs JSON formatted logs.

func NewJSONFormatter

func NewJSONFormatter(w io.Writer, prefix, indent string) *JSONFormatter

NewJSONFormatter creates a new JSONFormatter that writes to with the specified prefix and indent.

func (*JSONFormatter) Format

func (js *JSONFormatter) Format(v any) error

Format formats the specified value as JSON.

func (*JSONFormatter) Write

func (js *JSONFormatter) Write(p []byte) (n int, err error)

Write implements the io.Writer interface and it assumes that it is called with a complete JSON object.

Directories

Path Synopsis
Package ctxlog provides a context key and functions for logging to a context.
Package ctxlog provides a context key and functions for logging to a context.

Jump to

Keyboard shortcuts

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