Skip to content

Debug and DebugFormatter trait #1465

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
alex-s168 opened this issue May 2, 2025 · 2 comments
Open

Debug and DebugFormatter trait #1465

alex-s168 opened this issue May 2, 2025 · 2 comments
Assignees
Labels
enhancement New feature or request

Comments

@alex-s168
Copy link
Collaborator

let .debug(self: String, dbg: db+DebugFormatter): db = (
  dbg.str(self)
);

let .debug(self: User, dbg: db+DebugFormatter): db = (
  dbg.tag("User")
     .begin-struct-group()
     .field("name").kv().and(self.name)
     .field("mail").kv().and(self.mail)
     .end-struct-group()
);
@alex-s168 alex-s168 added the enhancement New feature or request label May 2, 2025
@alex-s168 alex-s168 self-assigned this May 2, 2025
@andrew-johnson-4
Copy link
Collaborator

Key points:

  • Force debug to use a specific format so that tooling can be build to support it

@andrew-johnson-4
Copy link
Collaborator

andrew-johnson-4 commented May 3, 2025

From an end user how do you think they will want to write debug messages?

I was thinking something like debug( channel, event ) that way the user will provide even more information.

Channels seem like a useful pattern for pub/sub style debugging.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: No status
Development

No branches or pull requests

2 participants