logsetup

package
v0.35.6 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2026 License: GPL-3.0 Imports: 6 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package logsetup turns the log settings of nps and npc into slogx configuration, the same way for both.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Apply

func Apply(o Options) error

Apply configures slogx.Default as o says and sends the standard library's logger to it.

Types

type Options

type Options struct {
	Output   string // stdout, file, both, off
	Format   string // text, json
	Level    string
	Path     string // file; relative to Dir
	Security string // security log file; relative to Dir
	Dir      string
	MaxSize  int // MB
	MaxFiles int
	MaxDays  int
	// Memory keeps the last entries in memory (npc SDK, a log viewer).
	Memory   int
	Compress bool
	// Service: a service has no console, so stdout means the file.
	Service bool
	// Secrets writes keys and passwords in lines, for development
	// (slogx.Config.LogSecrets).
	Secrets bool
	// Instance, when set, is written as instance= on every line.
	Instance string
}

Options are the log settings as nps.conf and the npc flags give them.

func (Options) Config

func (o Options) Config() (slogx.Config, error)

Config returns the slogx configuration of o.

Jump to

Keyboard shortcuts

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