Skip to content

Conversation

MaximeLemolt
Copy link

Provide a solution for issue Resolve #6252

Copy link

@MurzNN MurzNN left a comment

Choose a reason for hiding this comment

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

Reviewed and tested locally - it works well with no issues, thank you!

Copy link
Member

@weitzman weitzman left a comment

Choose a reason for hiding this comment

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

This is incomplete. Dates shown as part of list will not be able to be custom formatted, for example. I'm not sure we really need this but I'll reserve judgement until a more complete PR arrives.

#[CLI\Option(name: 'severity-min', description: 'Restrict to messages of a given severity level and higher.')]
#[CLI\Option(name: 'type', description: 'Restrict to messages of a given type.')]
#[CLI\Option(name: 'extended', description: 'Return extended information about each message.')]
#[CLI\Option(name: 'date_format', description: 'Specify a date format for the date console output.')]
Copy link
Member

Choose a reason for hiding this comment

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

We typically use dashes in option names not underscores.

Copy link
Author

Choose a reason for hiding this comment

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

Fixed

@MaximeLemolt MaximeLemolt force-pushed the allow-configuring-the-date-format-in-watchdog-console-output branch from 6bb4caa to a7fce11 Compare April 23, 2025 13:13
@MaximeLemolt
Copy link
Author

@weitzman Yes, it was incomplete. I've made the necessary changes to allow the configuration of a date format for the “watchdog:list” and “watchdog:show-one” commands.

I'm not sure if this is really necessary, but it meets a user need at a lower cost.

@weitzman
Copy link
Member

weitzman commented Aug 5, 2025

One alternative is to use cell rendering to format the date instead of doing it in the formatResult(). That way json/yaml/csv outputs would not do cennrendering and would get timestamps. Those are presumably easier to consume for scripts. I'm not sure if that would help with your client need. This approach breaks backward compat for scripts unfortunately.

Lets think about this a bit more. Sorry for the delay.

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.

Allow configuring the date fomat in the watchdog show output
3 participants