Skip to content
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

./gno.land/{pkg,cmd}/gnoland: use a logger and remove commands.IO #1419

Open
moul opened this issue Dec 7, 2023 · 0 comments
Open

./gno.land/{pkg,cmd}/gnoland: use a logger and remove commands.IO #1419

moul opened this issue Dec 7, 2023 · 0 comments

Comments

@moul
Copy link
Member

moul commented Dec 7, 2023

Context: #999 (comment)

  • Instead of using commands.IO, gnoland should use a logger. The main purpose of gnoland is to log information, not to interact with stdin or write raw stdout/stderr. Using a logger is more suitable and allows for clear unit tests without the need for monkey patching.
  • For other binaries, particularly CLI tools, we should assess whether the logger should be used more extensively in place of commands.IO. Alternatively, we can explore the option of commands.IO incorporating the logger or simply passing both more frequently.
  • Bonus: The gnoland binary should not have access to os.Stdin. We can use build tags to configure os.Stdin as a noop reader.

Thanks to @piux2 for highlighting the need for this change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: 📥 Inbox
Development

No branches or pull requests

1 participant