Logging

Description

Logging API 🔗

This mod provides an easy way to construct a logger for mods. All messages are formatted like [name] <message> in the console and debug.txt.

Usage 🔗

-- Let's say your mod's name is "mymod".
local logger = logging.logger("mymod")

-- This logs a message in the WARNING level.
-- These levels are avaliable: none, error, warning, action, info, verbose
logger:warning("Test warning")
--- Output: WARNING[Main]: [mymod] Test warning


-- This creates a sublogger named mycomponent
-- The resulting name will be mymod.mycomponent
local sublogger = logger:sublogger("mycomponent")

-- Log with the sublogger
sublogger:action("Test action")
--- Output: ACTION[Main]: [mymod.mycomponent] Test action

-- Assert if an condition is true
sublogger:assert(true, "lol")
--- Output: nothing (assertion succeed)

-- Raise an error with the given message
sublogger:raise("Test crash")
--- Result: Crashes with "[mymod.mycomponent] Test crash"

Reviews

Review

Do you recommend this mod?

  • No reviews, yet.

Releases

2025-04-12

Download

2025-04-12 02:13 UTC

2025-04-12 🔗

  • add deprecated log level

2025-01-21

Download

2025-01-21 02:14 UTC

2025-01-21 🔗

  • Use JPG screenshot
  • add supported games
  • Ensure values actually go through dump
  • optimizations

2024-07-02

Download

2024-07-02 02:15 UTC

2024-07-02 🔗

No release notes

2024-06-22

Download

2024-06-22 02:13 UTC

2024-06-22 🔗

No release notes

2024-04-03

Download

2024-04-03 02:14 UTC

2024-04-03 🔗

No release notes

All releases

Information

Provides

logging

Dependencies

Required
No required dependencies

Information

Type
Mod
Technical Name
logging
Languages
English
License
LGPL-2.1-or-later
Maintenance State
Actively Developed
Added
2024-02-23 15:07 UTC
Maintainers
1F616EMO

Used By