Tests: python: use quoted annotations to support python <= 3.6
[lttng-tools.git] / tests / utils / lttngtest / logger.py
CommitLineData
ef945e4d
JG
1#!/usr/bin/env python3
2#
3# Copyright (C) 2022 Jérémie Galarneau <jeremie.galarneau@efficios.com>
4#
5# SPDX-License-Identifier: GPL-2.0-only
6
7from typing import Callable, Optional
8
9
10class _Logger:
ce8470c9
MJ
11 def __init__(self, log):
12 # type: (Optional[Callable[[str], None]]) -> None
13 self._logging_function = log # type: Optional[Callable[[str], None]]
ef945e4d 14
ce8470c9
MJ
15 def _log(self, msg):
16 # type: (str) -> None
ef945e4d
JG
17 if self._logging_function:
18 self._logging_function(msg)
19
20 @property
ce8470c9
MJ
21 def logger(self):
22 # type: () -> Optional[Callable[[str], None]]
ef945e4d 23 return self._logging_function
This page took 0.035936 seconds and 4 git commands to generate.