{"id":17137023,"url":"https://github.com/sinisterrectus/jsonlog","last_synced_at":"2026-05-02T14:44:40.101Z","repository":{"id":69192199,"uuid":"148405585","full_name":"SinisterRectus/JSONLog","owner":"SinisterRectus","description":"JSON metadata logger and analyzer","archived":false,"fork":false,"pushed_at":"2019-12-03T18:56:48.000Z","size":7,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-11-11T22:20:24.715Z","etag":null,"topics":["discord","lua","luvit"],"latest_commit_sha":null,"homepage":null,"language":"Lua","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/SinisterRectus.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-09-12T01:53:40.000Z","updated_at":"2022-08-24T15:07:31.000Z","dependencies_parsed_at":null,"dependency_job_id":"f736250e-6081-489c-8a42-812391a7fdd5","html_url":"https://github.com/SinisterRectus/JSONLog","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/SinisterRectus/JSONLog","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SinisterRectus%2FJSONLog","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SinisterRectus%2FJSONLog/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SinisterRectus%2FJSONLog/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SinisterRectus%2FJSONLog/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SinisterRectus","download_url":"https://codeload.github.com/SinisterRectus/JSONLog/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SinisterRectus%2FJSONLog/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32538268,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-02T12:25:33.646Z","status":"ssl_error","status_checked_at":"2026-05-02T12:24:51.733Z","response_time":132,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["discord","lua","luvit"],"created_at":"2024-10-14T20:06:02.400Z","updated_at":"2026-05-02T14:44:40.078Z","avatar_url":"https://github.com/SinisterRectus.png","language":"Lua","funding_links":[],"categories":[],"sub_categories":[],"readme":"# JSONLog\r\n\r\nJSON metadata logger and analyzer written in Lua for the Luvit framework.\r\n\r\nInitially written for logging Discord WebSocket payloads, but can be used for any [dkjson](http://dkolf.de/src/dkjson-lua.fsl/home)-compatible data.\r\n\r\nWork-in-progress.\r\n\r\n### Instructions\r\n\r\n- Initialize a `JSONLog` object with a log name as its only argument.\r\n- Add a key, value pair to the log with `JSONLog:add(k, v)`\r\n- To cache the log's state for future use, call `JSONLog:dumpState()`. The filename `\u003cname\u003e_state.json` is used.\r\n- To output a human-readable analysis of the logged JSON, call `JSONLog:dumpPretty()`. The filename `\u003cname\u003e_pretty.txt` is used.\r\n- Optionally call `JSONLog:startLoop(ms)` to initilize a loop that periodically calls `JSONLog:dumpState()` and `JSONLog:dumpPretty()`\r\n- Optionally call `JSONLog:stopLoop()` to stop the dump loop.\r\n\r\n### Discordia Example\r\n\r\n```lua\r\nlocal discordia = require('../discordia') -- adjust path as necessary\r\nlocal JSONLog = require('./JSONLog') -- adjust path as necessary\r\nlocal json = require('json')\r\n\r\nlocal client = discordia.Client()\r\n\r\nlocal log = JSONLog('events')\r\n\r\nlocal ms = discordia.Time.fromSeconds(30):toMilliseconds()\r\nlog:startLoop(ms)\r\n\r\nclient:on('ready', function() return print('ready') end)\r\n\r\nclient:on('raw', function(str)\r\n\tlocal payload = json.decode(str, 1, json.null)\r\n\tif payload.op == 0 then\r\n\t\tlog:add(payload.t, payload.d)\r\n\tend\r\nend)\r\n\r\nclient:run('\u003cTOKEN\u003e')\r\n```\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsinisterrectus%2Fjsonlog","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsinisterrectus%2Fjsonlog","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsinisterrectus%2Fjsonlog/lists"}