Skip to content

Commit

Permalink
Use formatter logging when executed from CI/CD
Browse files Browse the repository at this point in the history
  • Loading branch information
jordimas committed Dec 27, 2024
1 parent 7ccbe08 commit f2fa250
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/generate_quality_reports.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,16 @@ def init_logging(self, del_logs):

if LOGSTDOUT == "0":
console = logging.StreamHandler() # By default uses stderr
if LOGLEVEL != "INFO":
console.setFormatter(formatter)
else:
console = logging.StreamHandler(stream=sys.stdout)
console.setFormatter(formatter)

logging.basicConfig(filename=logfile, level=logging.DEBUG)
logger = logging.getLogger("")
console.setLevel(LOGLEVEL)

if LOGLEVEL != "INFO":
console.setFormatter(formatter)

logger.addHandler(console)

Expand Down

0 comments on commit f2fa250

Please sign in to comment.