Add logging and capture & style execution output #24
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Add extensive info, debug, and trace logging throughout. The CLI will style and emit log messages at the INFO level or higher.
Upgrade pgxn_meta to v0.6.0 and add a test to the API to ensure it can properly handle Meta API requests to api.pgxn.org, which adds fields supported by pgxn_meta v0.6.0.
Add the
linesmodule, which defines a trait,line::WriteLine, for writing lines of text. It also defines two implementations:LineWriter, which simply writes lines to astd::io::Write, andColorLine, which uses anowo_colors::Styleto style a line before writing it to astd::io::Write. UseLineWriterto capture output during tests, so it doesn't appear in test output. Hopefully we'll also eventually be able to test that output, but for now ownership rules prevent it.Add the
execmodule to set the directory context for the execution of a command and to stream its STDOUT and STDERR output tolines::WriteLinevalues. This allows for the styling and capturing of output.Import the
apiandpg_configmodules instead of making them directly public.Remove the generics and lifetimes from most structs. This greatly simplifies building structs from other structs, and allows the
exec::Executorto be passed to Pipeline constructors instead of a directory. This allows the module to set up the default execution output streaming, styling STDOUT in light grey and STDERR in red by streaming them toline::ColorLinestructs that wrap our STDOUT and STDERR. Ultimately this configuration may move to consumers.For better or worse, the need for the line writers to be mutable requires that the Pipelines be mutable, too.