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

Better logging control #102

Merged
merged 4 commits into from
Oct 14, 2022
Merged

Better logging control #102

merged 4 commits into from
Oct 14, 2022

Conversation

chelnak
Copy link
Owner

@chelnak chelnak commented Oct 9, 2022

This commit adds a new internal package called logging. It exposes the Logger interface. The package also includes two loggers that implement the Logger interface.

TEXT - this logger uses zerolog and will print out a sequential list of events.

SPINNER - even though this is technically not a logger, this option implements a spinner that is used to display events.

The type of logger used is determined by the LoggerType options. The LoggerType is passed to the constructor which will return the correct logging implementation.

@chelnak chelnak added the enhancement New feature or request label Oct 9, 2022
@chelnak chelnak self-assigned this Oct 9, 2022
@chelnak chelnak linked an issue Oct 9, 2022 that may be closed by this pull request
@chelnak chelnak changed the title Logging Better logging control Oct 9, 2022
This commit adds a new internal package called logging. It exposes the
Logger interface. The package also includes two loggers that implement
the Logger interface.

TEXT - this logger uses zerolog and will print out a sequential list of
events.

SPINNER - even though this is technically not a logger, this option
implements a spinner that is used to display events.

The type of logger used is determined by the LoggerType options. The
LoggerType is passed to the constructor which will return the correct
logging implementation.
This commit implements the logging package. The builder is not aware of
the specific implementation of the logger, it just cares about methods
exposed by the Logger interface.
This commit removes the 's' from tags so that the output looks better
when using text-mode logging.
@chelnak chelnak force-pushed the logging branch 2 times, most recently from 7bc4cb0 to 5a86bef Compare October 14, 2022 06:17
This commit adds the environment package. It currently contains one
function that is used to determine whether or not the app is running in
CI.

For most popular CI products this assertion is made by including an
environment variable called `CI`.

IsCI checks for the existence of this environment variable. If it is
set to true then we return a boolean true.
@chelnak chelnak merged commit cb3b0e4 into main Oct 14, 2022
@chelnak chelnak deleted the logging branch October 14, 2022 06:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement logging
1 participant