Forest Logo
search
package_2

logger

By @ptekspy

Roblox

Mirrored

Logger

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

  • Log is an alias for Info
  • Debug, Info, Warn, Error will only log when the current level allows it
  • Error still raises an error so execution stops as expected
  • enabled defaults to Studio mode unless explicitly configured otherwise

Package Details

Install command (Click to copy)


Version

1.1.0

License

Apache-2.0

check_circle

Safe for commercial use

infoModified 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.