stdoutlog

package module
v0.2.0-alpha Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

README

STDOUT Log Exporter

PkgGoDev

Documentation

Overview

Package stdoutlog provides an exporter for OpenTelemetry log telemetry.

The exporter is intended to be used for testing and debugging, it is not meant for production use. Additionally, it does not provide an interchange format for OpenTelemetry that is supported with any stability or compatibility guarantees. If these are needed features, please use the OTLP exporter instead.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Exporter

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

Exporter writes JSON-encoded log records to an io.Writer (os.Stdout by default). Exporter must be created with New.

func New

func New(options ...Option) (*Exporter, error)

New creates an Exporter.

func (*Exporter) Export

func (e *Exporter) Export(ctx context.Context, records []log.Record) error

Export exports log records to writer.

func (*Exporter) ForceFlush

func (e *Exporter) ForceFlush(context.Context) error

ForceFlush performs no action.

func (*Exporter) Shutdown

func (e *Exporter) Shutdown(context.Context) error

Shutdown shuts down the Exporter. Calls to Export will perform no operation after this is called.

type Option

type Option interface {
	// contains filtered or unexported methods
}

Option sets the configuration value for an Exporter.

func WithPrettyPrint

func WithPrettyPrint() Option

WithPrettyPrint prettifies the emitted output.

func WithWriter

func WithWriter(w io.Writer) Option

WithWriter sets the export stream destination.

func WithoutTimestamps

func WithoutTimestamps() Option

WithoutTimestamps sets the export stream to not include timestamps.

Jump to

Keyboard shortcuts

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