Method: flask.logging.create_logger
Calls: 19, Exceptions: 0, Paths: 4Back
Path 1: 14 calls (0.74)
Flask (13) test_session_error_pops_context.
Logger (14)
1def create_logger(app: Flask) -> logging.Logger:
2 """Get the Flask app's logger and configure it if needed.
3
4 The logger name will be the same as
5 :attr:`app.import_name <flask.Flask.name>`.
6
7 When :attr:`~flask.Flask.debug` is enabled, set the logger level to
8 :data:`logging.DEBUG` if it is not set.
9
10 If there is no handler for the logger's effective level, add a
11 :class:`~logging.StreamHandler` for
12 :func:`~flask.logging.wsgi_errors_stream` with a basic format.
13 """
14 logger = logging.getLogger(app.name)
15
16 if app.debug and not logger.level:
17 logger.setLevel(logging.DEBUG)
18
19 if not has_level_handler(logger):
20 logger.addHandler(default_handler)
21
22 return logger
Path 2: 3 calls (0.16)
Flask (3)
Logger (3)
1def create_logger(app: Flask) -> logging.Logger:
2 """Get the Flask app's logger and configure it if needed.
3
4 The logger name will be the same as
5 :attr:`app.import_name <flask.Flask.name>`.
6
7 When :attr:`~flask.Flask.debug` is enabled, set the logger level to
8 :data:`logging.DEBUG` if it is not set.
9
10 If there is no handler for the logger's effective level, add a
11 :class:`~logging.StreamHandler` for
12 :func:`~flask.logging.wsgi_errors_stream` with a basic format.
13 """
14 logger = logging.getLogger(app.name)
15
16 if app.debug and not logger.level:
17 logger.setLevel(logging.DEBUG)
18
19 if not has_level_handler(logger):
20 logger.addHandler(default_handler)
21
22 return logger
Path 3: 1 calls (0.05)
Flask (1)
Logger (1)
1def create_logger(app: Flask) -> logging.Logger:
2 """Get the Flask app's logger and configure it if needed.
3
4 The logger name will be the same as
5 :attr:`app.import_name <flask.Flask.name>`.
6
7 When :attr:`~flask.Flask.debug` is enabled, set the logger level to
8 :data:`logging.DEBUG` if it is not set.
9
10 If there is no handler for the logger's effective level, add a
11 :class:`~logging.StreamHandler` for
12 :func:`~flask.logging.wsgi_errors_stream` with a basic format.
13 """
14 logger = logging.getLogger(app.name)
15
16 if app.debug and not logger.level:
17 logger.setLevel(logging.DEBUG)
18
19 if not has_level_handler(logger):
20 logger.addHandler(default_handler)
21
22 return logger
Path 4: 1 calls (0.05)
Flask (1)
Logger (1)
1def create_logger(app: Flask) -> logging.Logger:
2 """Get the Flask app's logger and configure it if needed.
3
4 The logger name will be the same as
5 :attr:`app.import_name <flask.Flask.name>`.
6
7 When :attr:`~flask.Flask.debug` is enabled, set the logger level to
8 :data:`logging.DEBUG` if it is not set.
9
10 If there is no handler for the logger's effective level, add a
11 :class:`~logging.StreamHandler` for
12 :func:`~flask.logging.wsgi_errors_stream` with a basic format.
13 """
14 logger = logging.getLogger(app.name)
15
16 if app.debug and not logger.level:
17 logger.setLevel(logging.DEBUG)
18
19 if not has_level_handler(logger):
20 logger.addHandler(default_handler)
21
22 return logger