summaryrefslogtreecommitdiffstats
path: root/scripts/jira/jira-bug-closer/logger/logger.py
blob: aeaed92eb2460e424671734637d8b8d68b8350ab (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#!/usr/bin/env python3
# Copyright (C) 2019 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0

import coloredlogs
import logging

level = logging.INFO


def get_logger(name: str) -> logging.Logger:
    log = logging.getLogger(name)
    log.setLevel(level)
    log_format = "%(asctime)s %(filename)s:%(lineno)d %(levelname)s %(message)s"
    coloredlogs.install(level=level, logger=log, fmt=log_format)
    return log