Skip to content

Commit

Permalink
Add the yaml env load
Browse files Browse the repository at this point in the history
  • Loading branch information
athiruma committed Sep 13, 2024
1 parent b87a1e5 commit dd993f0
Show file tree
Hide file tree
Showing 3 changed files with 140 additions and 55 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -218,3 +218,4 @@ empty_test_environment_variables.py
/cloud_governance/policy/send_mail.py
cloudsensei/.env.txt
.vscode
cloud_governance/main/env.yaml
10 changes: 4 additions & 6 deletions cloud_governance/common/logger/init_logger.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,18 @@
import sys
import logging

from cloud_governance.main.environment_variables import environment_variables

logger_category_name = 'cloud_governance'
logger = logging.getLogger(logger_category_name) # instantiating a logger
handler = logging.StreamHandler(sys.stdout)
# log for output only
#log_path = os.getcwd()
#fileHandler = logging.FileHandler(filename=f'{log_path}/cloud_governance.log', mode='w+')
account_name = environment_variables.environment_variables_dict.get('account')
# log_path = os.getcwd()
# fileHandler = logging.FileHandler(filename=f'{log_path}/cloud_governance.log', mode='w+')
account_name = os.environ.get('account')
log_format = f'[%(levelname)s] %(asctime)s {account_name} - %(message)s'
formatter = logging.Formatter(log_format)
handler.setFormatter(formatter)
logger.addHandler(handler)
#logger.addHandler(fileHandler)
# logger.addHandler(fileHandler)


# def get_pyperf_log_path():
Expand Down
Loading

0 comments on commit dd993f0

Please sign in to comment.