-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Commits since 0.19.0 branch freeze #1315
Merged
Merged
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
ce192f4
fix: default to nodejs10.x on init
sriram-mv 2e5f7f1
fix: programatically choose latest node runtime as `default`
sriram-mv 666e366
comments: add comments on runtime ordering per language
sriram-mv ad9a171
fix: Respect zipped symlinks (#1140)
bubba-h57 f19f218
doc: Adding testing guidelines (#1201)
sanathkr 0b452bd
fix: Update copyright in LICENSE (#1295)
jfuss 08049e8
fix: Update error message for package and deploy (#1152)
zafarella 879cad4
chore: Upgrade dependencies (#1286)
jfuss fb06abe
feat(cli-logs): Configure and format SAM CLI logging to console (#1118)
jfuss b128a58
Merge pull request #1275 from TheSriram/node_init_fix
sriram-mv 6e16dd0
Merge branch 'develop' into candidate/release/20
sanathkr 45a6841
Fix Flake8
jfuss 360d90a
Revert "fix: Respect zipped symlinks (#1140)"
jfuss File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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 |
---|---|---|
@@ -1,16 +1,16 @@ | ||
six~=1.11.0 | ||
chevron~=0.12 | ||
click~=6.7 | ||
click~=7.0 | ||
enum34~=1.1.6; python_version<"3.4" | ||
Flask~=1.0.2 | ||
boto3~=1.9, >=1.9.56 | ||
PyYAML~=3.12 | ||
PyYAML~=5.1 | ||
cookiecutter~=1.6.0 | ||
aws-sam-translator==1.10.0 | ||
docker~=3.7.0 | ||
docker~=4.0 | ||
dateparser~=0.7 | ||
python-dateutil~=2.6 | ||
pathlib2~=2.3.2; python_version<"3.4" | ||
requests==2.22.0 | ||
serverlessrepo==0.1.8 | ||
serverlessrepo==0.1.9 | ||
aws_lambda_builders==0.3.0 |
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
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
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,31 @@ | ||
""" | ||
Configures a logger | ||
""" | ||
import logging | ||
|
||
|
||
class SamCliLogger(object): | ||
|
||
@staticmethod | ||
def configure_logger(logger, formatter, level): | ||
""" | ||
Configure a Logger with the formatter provided. | ||
|
||
Parameters | ||
---------- | ||
logger logging.getLogger | ||
Logger to configure | ||
formatter logging.formatter | ||
Formatter for the logger | ||
|
||
Returns | ||
------- | ||
None | ||
""" | ||
log_stream_handler = logging.StreamHandler() | ||
log_stream_handler.setLevel(logging.DEBUG) | ||
log_stream_handler.setFormatter(formatter) | ||
|
||
logger.setLevel(level) | ||
logger.propagate = False | ||
logger.addHandler(log_stream_handler) |
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
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
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,25 @@ | ||
from unittest import TestCase | ||
from mock import patch, Mock | ||
|
||
from samcli.lib.utils.sam_logging import SamCliLogger | ||
|
||
|
||
class TestSamCliLogger(TestCase): | ||
|
||
@patch("samcli.lib.utils.sam_logging.logging") | ||
def test_configure_samcli_logger(self, logging_patch): | ||
formatter_mock = Mock() | ||
logger_mock = Mock() | ||
logging_patch.DEBUG = 2 | ||
|
||
stream_handler_mock = Mock() | ||
logging_patch.StreamHandler.return_value = stream_handler_mock | ||
|
||
SamCliLogger.configure_logger(logger_mock, formatter_mock, level=1) | ||
|
||
self.assertFalse(logger_mock.propagate) | ||
|
||
logger_mock.setLevel.assert_called_once_with(1) | ||
logger_mock.addHandler.assert_called_once_with(stream_handler_mock) | ||
stream_handler_mock.setLevel.assert_called_once_with(2) | ||
stream_handler_mock.setFormatter.assert_called_once_with(formatter_mock) |
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍