anvilistas / anvil-extras

Other
84 stars 25 forks source link

Use a custom format logger to print Publisher messages #569

Closed GDuroS closed 3 weeks ago

GDuroS commented 1 month ago

Is your feature request related to a problem? Please describe. When using the Publisher class to publish or subscribe to a channel you can pass a parameter called "with_logging" to override the default way for printing in the console output.

Printing, however, would break the flow of logs when using a custom format of Logger (also from anvil-extras).

It would be interesting if the Publisher construtor and it's methods could receive a Logger instance to use to print in the correct format.

image

image

image

The Level could be INFO (by default or as parameter) and the same message printed now could be the msg parameter of the logger format.

s-cork commented 1 month ago

@GDuroS did you want to work on this PR?

GDuroS commented 1 month ago

@s-cork Sure, I could do this.

GDuroS commented 4 weeks ago

@s-cork I made the pull request, but to be honest, this is the first time I did a PR. If I did something wrong, let me know.