nlog

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2026 License: MPL-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package nlog captures redacted agent and Xray messages in a bounded stream.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BindXray

func BindXray(local xlog.Handler)

func Core

func Core() *slog.Logger

func Init

func Init(out io.Writer, level slog.Level, _ bool)

func RestoreXray

func RestoreXray()

Types

type Entry

type Entry struct {
	Time   time.Time `json:"time"`
	Source string    `json:"source"`
	Text   string    `json:"text"`
}

type Stream

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

func NewStream

func NewStream(out io.Writer) *Stream

func (*Stream) Drain

func (s *Stream) Drain() ([]Entry, uint64)

func (*Stream) Handle

func (s *Stream) Handle(msg xlog.Message)

func (*Stream) Redact

func (s *Stream) Redact(text string) string

func (*Stream) Secrets

func (s *Stream) Secrets(values ...string)

func (*Stream) SetSecrets

func (s *Stream) SetSecrets(values ...string)

func (*Stream) Severity

func (s *Stream) Severity() xlog.Severity

func (*Stream) Write

func (s *Stream) Write(b []byte) (int, error)

Jump to

Keyboard shortcuts

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