{"id":"ptekspy/logger","name":"logger","scope":"ptekspy","platform":"roblox","description":"Logger","version":"1.1.0","latest":"1.1.0","versions":["1.1.0"],"license":"Apache-2.0","licenseRating":"safe","licenseCaveats":["Modified files must carry a notice of changes. If the package ships a NOTICE file, its attributions must be preserved."],"licenseVerified":true,"dependencies":{},"integrity":"5204e5325808f16024158793900f4466b74bfa4d634ef53f4611275dead2c77e","likes":0,"downloads":0,"install":"forest install ptekspy/logger","url":"https://forest.dev/p/roblox/ptekspy/logger","files":"https://api.forest.dev/ai/package/roblox/ptekspy/logger/files","readme":"# Logger\r\n\r\nA small logger module with log levels, timestamp support, production toggles, and custom sinks.\r\n\r\n## Getting Started\r\n\r\nTo build the package use:\r\n\r\n```bash\r\nargon build\r\n```\r\n\r\nInstall the package with wally:\r\n\r\n```bash\r\nwally add ptekspy/Logger\r\n```\r\n\r\n## Usage\r\n\r\nRequire and use in your Luau code (adjust path as needed):\r\n\r\n```lua\r\nlocal Logger = require(path.to.Logger.init)\r\n\r\nlocal logger = Logger.new(\"MyStore\")\r\nlogger:Debug(\"starting\", {count = 1})\r\nlogger:Info(\"loaded\")\r\nlogger:Warn(\"missing value\")\r\n-- logger:Error(\"fatal\") -- raises an error\r\n```\r\n\r\n### Configuration\r\n\r\n```lua\r\nlocal logger = Logger.new(\"Store\", {\r\n    enabled = true,\r\n    level = \"Info\",\r\n    timestamps = true,\r\n    output = function(self, level, prefix, message)\r\n        -- Custom sink, e.g. send to remote logger\r\n        print(\"CUSTOM OUTPUT:\", message)\r\n    end,\r\n})\r\n\r\nlogger:SetLevel(\"Warn\")\r\nlogger:SetPrefix(\"NewStore\")\r\nlogger:SetEnabled(false)\r\nlogger:SetTimestamps(true)\r\n```\r\n\r\n### Notes\r\n\r\n- `Log` is an alias for `Info`\r\n- `Debug`, `Info`, `Warn`, `Error` will only log when the current level allows it\r\n- `Error` still raises an error so execution stops as expected\r\n- `enabled` defaults to Studio mode unless explicitly configured otherwise\r\n","readmeTruncated":false}