Skip to content

Conversation

@bomanaps
Copy link

@bomanaps bomanaps commented Aug 6, 2025

This Pr closes this #97
I have:

  • Created a new log command with list and set-level subcommands.
  • Created a management API server that exposes endpoints for listing and setting
    log levels.
  • Integrated the management server into the main application.
  • Used the cobra library to create the CLI commands.
  • Used the go-log/v2 library to manage logging.

The log command can be used like this:

  • piri log list: Lists all logging subsystems and their current levels.
  • piri log set-level : Sets the log level for a specific
    subsystem.
  • piri log set-level --all : Sets the log level for all subsystems.
    Please Note this is still a WIP and I still have some missing uint test implementation

Copy link
Member

@frrist frrist left a comment

Choose a reason for hiding this comment

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

Good stuff! Thank you @bomanaps <3

Sorry for the churn here, but I think it's best if we deviate from the initial issue - as will be evident from a few of the comments. Let me know if you have any questions.

cmd/cli/root.go Outdated
Comment on lines 65 to 67
rootCmd.PersistentFlags().String("manage-api", "127.0.0.1:8888", "Management API address")
cobra.CheckErr(viper.BindPFlag("manage_api", rootCmd.PersistentFlags().Lookup("manage-api")))

Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

Be sure to remove this still

@bomanaps bomanaps requested a review from frrist August 6, 2025 21:41
Copy link
Member

@frrist frrist left a comment

Choose a reason for hiding this comment

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

looking good, few more comments

cmd/cli/root.go Outdated
Comment on lines 65 to 67
rootCmd.PersistentFlags().String("manage-api", "127.0.0.1:8888", "Management API address")
cobra.CheckErr(viper.BindPFlag("manage_api", rootCmd.PersistentFlags().Lookup("manage-api")))

Copy link
Member

Choose a reason for hiding this comment

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

Be sure to remove this still

@bomanaps bomanaps requested a review from frrist August 7, 2025 09:52
@bomanaps bomanaps requested a review from frrist August 7, 2025 23:53
@bomanaps
Copy link
Author

Hello @frrist I added this unit test to it

TestLogList_PrintsSubsystemsAndLevels: Mock server returns subsystems and levels, verify formatted output.
TestLogSetLevel_WithExplicitSystems: Pass --system alpha --system beta, assert two POSTs with correct level.
TestLogSetLevel_AllSystemsWhenNoneSpecified: No --system flag; server returns alpha,beta,gamma; assert all three received POSTs.

Copy link
Member

@frrist frrist left a comment

Choose a reason for hiding this comment

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

Almost there, few more comments to address then we should be good to merge. thanks for the hard work here 🙂

@bomanaps bomanaps requested a review from frrist August 11, 2025 23:58
@bomanaps
Copy link
Author

Hello @frrist please am still waiting for your final comment on this?

@bomanaps
Copy link
Author

Hey @frrist please can you trigger the ci again although am not sure how to go about the AWS fail

@frrist
Copy link
Member

frrist commented Aug 13, 2025

Thanks @bomanaps will get this merged before our next release. Appreciate the effort you put in here ❤️.

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.

2 participants