search/
Start typing to search packages!
package_2
logger
By @ptekspy
Roblox
MirroredLogger
A small logger module with log levels, timestamp support, production toggles, and custom sinks.
Getting Started
To build the package use:
argon build
Install the package with wally:
wally add ptekspy/Logger
Usage
Require and use in your Luau code (adjust path as needed):
local Logger = require(path.to.Logger.init)
local logger = Logger.new("MyStore")
logger:Debug("starting", {count = 1})
logger:Info("loaded")
logger:Warn("missing value")
-- logger:Error("fatal") -- raises an error
Configuration
local logger = Logger.new("Store", {
enabled = true,
level = "Info",
timestamps = true,
output = function(self, level, prefix, message)
-- Custom sink, e.g. send to remote logger
print("CUSTOM OUTPUT:", message)
end,
})
logger:SetLevel("Warn")
logger:SetPrefix("NewStore")
logger:SetEnabled(false)
logger:SetTimestamps(true)
Notes
Logis an alias forInfoDebug,Info,Warn,Errorwill only log when the current level allows itErrorstill raises an error so execution stops as expectedenableddefaults to Studio mode unless explicitly configured otherwise
Package Details
Install command (Click to copy)
Version
1.1.0
License
Apache-2.0
Safe for commercial use
Modified files must carry a notice of changes. If the package ships a NOTICE file, its attributions must be preserved.
Automated license review — not legal advice.
