Skip to content

Add DMOD_LOG_STEP macros to driver configuration#30

Merged
JohnAmadis merged 3 commits intomainfrom
copilot/add-dmod-log-step-macros
Mar 6, 2026
Merged

Add DMOD_LOG_STEP macros to driver configuration#30
JohnAmadis merged 3 commits intomainfrom
copilot/add-dmod-log-step-macros

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 6, 2026

Driver configuration had no step-level visibility — when a driver crashed or failed to load, there was no clear indication of which configuration was in progress or at which stage it failed.

Changes

  • configure_driver: Replaced DMOD_LOG_VERBOSE at entry with DMOD_LOG_STEP_BEGIN to announce each driver configuration step. Each call to configure_driver (one per config file or per INI section with a driver_name key) now produces a distinct BEGIN/STEP pair.
  • Added DMOD_LOG_STEP_PROGRESS at each internal stage so the last printed line pinpoints exactly where a failure or crash occurred:
    • 25% — Loading driver module
    • 50% — Resolving driver interface (dmdrvi_create)
    • 75% — Creating driver context
    • 90% — Reading driver node path
  • Added DMOD_LOG_STEP(1, ...) on every failure return NULL path so the terminal shows [ FAIL ] + driver name on any error.
  • Replaced DMOD_LOG_INFO on the success path with DMOD_LOG_STEP(0, ...) to show [ OK ].
DMOD_LOG_STEP_BEGIN("Configuring driver: %s\n", driver_name);
DMOD_LOG_STEP_PROGRESS(25, "Loading driver module: %s\n", driver_name);
// ... load ...
DMOD_LOG_STEP_PROGRESS(50, "Resolving driver interface: %s\n", driver_name);
// ... resolve ...
DMOD_LOG_STEP_PROGRESS(75, "Creating driver context: %s\n", driver_name);
// ... create context ...
DMOD_LOG_STEP_PROGRESS(90, "Reading driver node path: %s\n", driver_name);
// ... read path ...
// on any failure:
DMOD_LOG_STEP(1, "Failed to configure driver: %s\n", driver_name);
// on success:
DMOD_LOG_STEP(0, "Configured driver: %s (path: %s)\n", driver_name, driver_node->path);

Existing DMOD_LOG_ERROR calls are preserved alongside DMOD_LOG_STEP failures to retain detailed error context.

Original prompt

This section details on the original issue you should resolve

<issue_title>Dodać używanie makr DMOD_LOG_STEP przy konfigurowaniu driverów</issue_title>
<issue_description>Do dmod'a zostały dodane nowe makra - DMOD_LOG_STEP, które pozwalają na wyświetlanie statusu kroków - powinniśmy ich użyć do wyświetlania informacji na temat ładowania kolejnych konfiguracji. Dla każdej konfiguracji powinien być osobny STEP, wraz z BEGIN, aby jak któryś scrashuje, to żeby było wiadomo skąd</issue_description>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

@JohnAmadis JohnAmadis marked this pull request as ready for review March 6, 2026 13:37
Co-authored-by: JohnAmadis <17320783+JohnAmadis@users.noreply.github.com>
Copilot AI changed the title [WIP] Add usage of DMOD_LOG_STEP macros for driver configuration Add DMOD_LOG_STEP macros to driver configuration Mar 6, 2026
Comment thread src/dmdevfs.c
static driver_node_t* configure_driver(const char* driver_name, dmini_context_t config_ctx)
{
DMOD_LOG_VERBOSE("Configuring driver: %s\n", driver_name);
DMOD_LOG_STEP_BEGIN("Configuring driver: %s\n", driver_name);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot dodaj jeszcze użycie DMOD_LOG_STEP_PROGRESS - aby było można się domyśleć na czym ta konfiguracja sfailowała

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in 88fb544. Added DMOD_LOG_STEP_PROGRESS at each stage of configure_driver:

  • 25% — Loading driver module
  • 50% — Resolving driver interface (dmdrvi_create)
  • 75% — Creating driver context
  • 90% — Reading driver node path

If a crash occurs at any stage, the last printed progress line will pinpoint exactly where in the configuration sequence the failure happened.

Co-authored-by: JohnAmadis <17320783+JohnAmadis@users.noreply.github.com>
@JohnAmadis JohnAmadis merged commit 6d2e808 into main Mar 6, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Dodać używanie makr DMOD_LOG_STEP przy konfigurowaniu driverów

2 participants