logx

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package logx implements the `log` native module: a leveled, timestamped logger usable from LuaScript. Defaults: level=INFO, output=stderr, no prefix. Output format mirrors most CLI tools:

2026-06-04T12:34:56 [INFO] msg parts joined with tabs

State (level / output writer / prefix) is per-module — one shared logger per `require("log")`. A second require returns the same cached table from package.loaded, so the configuration persists for the rest of the program. This matches how every other native here behaves and keeps the Lua-side API a flat, free-function shape.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterLogPreload

func RegisterLogPreload(v *vm.VM)

RegisterLogPreload installs the `log` module under package.preload.

Types

type Level

type Level int

Level orders messages from most to least severe. The constants are kept in this order so a single `>=` comparison gates emission.

const (
	LevelTrace Level = iota
	LevelDebug
	LevelInfo
	LevelWarn
	LevelError
	LevelFatal
)

Jump to

Keyboard shortcuts

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