forked from aws/aws-sam-cli
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: refactor logs command library (aws#2862)
* refactor logs command library * re-organize due to click usage * address comments * adding pylint disable for console consumer * make pylint happy with python 3.6 Co-authored-by: Mathieu Grandis <[email protected]>
- Loading branch information
Showing
25 changed files
with
986 additions
and
924 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
""" | ||
Consumers that will print out events to console | ||
""" | ||
|
||
import click | ||
|
||
from samcli.lib.observability.cw_logs.cw_log_event import CWLogEvent | ||
from samcli.lib.observability.observability_info_puller import ObservabilityEventConsumer | ||
|
||
|
||
class CWConsoleEventConsumer(ObservabilityEventConsumer[CWLogEvent]): | ||
""" | ||
Consumer implementation that will consume given event as outputting into console | ||
""" | ||
|
||
# pylint: disable=R0201 | ||
def consume(self, event: CWLogEvent): | ||
click.echo(event.message, nl=False) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.