-
Notifications
You must be signed in to change notification settings - Fork 57
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add http request timeout, improve logging (#77)
* logging, timeout * makefile, aws template * shipper * makefile, aws template * shipper, template * gitignore, remove git-secrets workflow, add pre commit config * update cw makefile * readme * reamde bump version in links * fix template, readme
- Loading branch information
Showing
10 changed files
with
114 additions
and
62 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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 +1,4 @@ | ||
.prettierignore | ||
.prettierignore | ||
.idea | ||
.DS_Store | ||
*/*/dist |
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,8 @@ | ||
repos: | ||
- repo: https://github.com/cycodehq-public/cycode-cli | ||
rev: 0.1.6 | ||
hooks: | ||
- id: cycode | ||
language_version: python3 | ||
stages: | ||
- commit |
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,9 +1,11 @@ | ||
build: | ||
mkdir -p dist/python3/shipper | ||
mkdir -p dist/python3/custom_logger | ||
cp src/lambda_function.py dist | ||
cp ../shipper/shipper.py dist/python3/shipper | ||
cp ../custom_logger/custom_logger.py dist/python3/custom_logger | ||
|
||
(cd dist/ && zip -r logzio-cloudwatch-log-shipper.zip lambda_function.py python3/shipper/*) | ||
(cd dist/ && zip -r logzio-cloudwatch-log-shipper.zip lambda_function.py python3/shipper/* python3/custom_logger/*) | ||
|
||
clean: | ||
rm -rf dist/ |
Large diffs are not rendered by default.
Oops, something went wrong.
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
Empty file.
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,17 @@ | ||
import logging | ||
import os | ||
|
||
LOG_LEVEL_ENV = 'SHIPPER_LOG_LEVEL' | ||
DEFAULT_LEVEL = 'INFO' | ||
|
||
|
||
def get_logger(name): | ||
level_str = os.getenv(LOG_LEVEL_ENV, DEFAULT_LEVEL) | ||
logger = logging.getLogger(name) | ||
try: | ||
level = logging.getLevelName(level_str) | ||
logger.setLevel(level) | ||
except Exception as e: | ||
logger.setLevel(logging.INFO) | ||
logger.warning(f'Could not set logger to level {level_str}, setting to default level {DEFAULT_LEVEL}: {e}') | ||
return logger |
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