Skip to content

Commit

Permalink
dynamic env var
Browse files Browse the repository at this point in the history
  • Loading branch information
scriptingislife committed Feb 5, 2020
1 parent 84b1a4a commit ad5148b
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/logging_help.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ def get_secret():
else:
# Decrypts secret using the associated KMS CMK.
# Depending on whether the secret is a string or binary, one of these fields will be populated.
print(get_secret_value_response)
if 'SecretString' in get_secret_value_response:
secret = get_secret_value_response['SecretString']
else:
Expand All @@ -73,13 +72,20 @@ def get_secret():
return json.loads(secret).get('logdna-ingestion')

def log_scan(db_data):

log_env = "unknown"

if "CI" in os.environ and os.environ.get("CI") == True:
log_env = "test"
else:
log_env = "production"

logdna = get_secret()
print(logdna)

logdata = {
"lines": [
{
"line": "A new scan was initiated.",
"line": "A new scan was initiated | {}".format(db_data["title"]),
"app": "glimpse",
"level": "INFO",
"env": "experiment",
Expand Down

0 comments on commit ad5148b

Please sign in to comment.