logutil

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2025 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// CurrentVerbosity is the current verbosity level
	CurrentVerbosity = NormalLevel
	// ShowTimestamps controls whether timestamps are shown
	ShowTimestamps = false
)

Functions

func Error

func Error(format string, args ...any)

func Info

func Info(format string, args ...any)

func SetTimestamps

func SetTimestamps(enabled bool)

SetTimestamps enables or disables timestamps

func SetVerbosity

func SetVerbosity(level VerbosityLevel)

SetVerbosity sets the current verbosity level

func Signal

func Signal(kind, ruleID, severity, title, extra string)

Signal formats any detection signal (simple, correlation, baseline). kind is "rule", "correlation", or "baseline" (no longer displayed in output). extra contains context information that will be displayed on a second line (only in verbose mode).

func SignalContext

func SignalContext(context map[string]string) string

SignalContext formats signal context information for the second line

func Success

func Success(format string, args ...any)

func Verbose

func Verbose(format string, args ...any)

Verbose logs a message only in verbose mode

func Warn

func Warn(format string, args ...any)

Types

type VerbosityLevel

type VerbosityLevel int

VerbosityLevel represents the logging verbosity

const (
	// NormalLevel shows standard output (default)
	NormalLevel VerbosityLevel = iota
	// VerboseLevel shows additional details and timestamps
	VerboseLevel
)

Jump to

Keyboard shortcuts

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