Skip to content

refactor: extract logging/debug refactor from PR #1292#1308

Merged
derfloh205 merged 6 commits into
mainfrom
copilot/extract-logging-changes-another-one
Apr 17, 2026
Merged

refactor: extract logging/debug refactor from PR #1292#1308
derfloh205 merged 6 commits into
mainfrom
copilot/extract-logging-changes-another-one

Conversation

Copilot AI commented Apr 17, 2026

Copy link
Copy Markdown
Contributor

Summary

Extracts only the logging/debug refactor changes from PR #1292 (refactor/EventBasedModules) into an independent PR branched from main. This separates the logging system upgrade from the work-in-progress module loading process refactor.

Changes

LibLog-1.0 Integration

  • Added LibLog-1.0 library dependency (embeds.xml, Init/GLibs.lua, already in .pkgmeta)
  • Provides structured logging with log levels (DEBUG, INFO, WARN, ERROR, etc.)

Debug Module Restructuring

  • Moved Modules/Debug/Debug.luaDebug/Debug.lua (top-level, since Debug is infrastructure, not a module)
  • Moved Modules/Debug/UI.luaDebug/UI.lua
  • New Debug UI with log viewer button and log level selector dropdown
  • Updated CraftSim.toc to reflect new file paths

Logging Migration (85+ files)

  • Replaced CraftSim.DEBUG:RegisterDebugID("X") / print() pattern with CraftSim.DEBUG:RegisterLogger("X") / Logger:LogDebug() pattern across all source files
  • Removed duplicate inner RegisterDebugID/RegisterLogger calls from functions, using file-level Logger consistently
  • Added deprecated RegisterDebugID backwards-compatibility shim in Debug/Debug.lua

DB and Options

  • Changed DEBUG_IDS option → DEBUG_MINIMUM_LOG_LEVEL (defaults to ERROR level)
  • Added migration M_16_17_Remove_DebugID_SavedVariable to clean up old saved variable
  • Updated Util/Const.lua defaults

What is NOT included (stays in PR #1292)

  • Module loading process refactor (event-based modules, RegisterModule, MODULES_ENABLED)
  • FRAMES enum removal from Util/Const.lua
  • Module type annotation changes (CraftSim.Module base class)
  • UpdateUI/UpdateDisplayUpdate method renames
  • VisibleByContext additions
  • ControlPanel module registration
  • AverageProfit module removal
  • Custom event system (CRAFTSIM_OPEN_RECIPE_INFO_UPDATED, etc.)

Copilot AI and others added 3 commits April 17, 2026 11:37
…bulk print to Logger changes

Agent-Logs-Url: https://github.com/derfloh205/CraftSim/sessions/2eca3faa-5ba2-41e7-b37b-9637c6a38250

Co-authored-by: derfloh205 <9341090+derfloh205@users.noreply.github.com>
…ion issues in restored files

Agent-Logs-Url: https://github.com/derfloh205/CraftSim/sessions/2eca3faa-5ba2-41e7-b37b-9637c6a38250

Co-authored-by: derfloh205 <9341090+derfloh205@users.noreply.github.com>
… Logger consistently

Agent-Logs-Url: https://github.com/derfloh205/CraftSim/sessions/2eca3faa-5ba2-41e7-b37b-9637c6a38250

Co-authored-by: derfloh205 <9341090+derfloh205@users.noreply.github.com>
@derfloh205 derfloh205 marked this pull request as ready for review April 17, 2026 12:43
@derfloh205 derfloh205 merged commit 19adc96 into main Apr 17, 2026
@derfloh205 derfloh205 deleted the copilot/extract-logging-changes-another-one branch April 17, 2026 12:44
@github-project-automation github-project-automation Bot moved this from Backlog to Done in CraftSim Apr 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

2 participants