Tests: add basic ust context tests for $app, vpid, vuid, vgid
[lttng-tools.git] / tests / utils / lttngtest / logger.py
diff --git a/tests/utils/lttngtest/logger.py b/tests/utils/lttngtest/logger.py
new file mode 100644 (file)
index 0000000..9f90ec0
--- /dev/null
@@ -0,0 +1,20 @@
+#!/usr/bin/env python3
+#
+# Copyright (C) 2022 Jérémie Galarneau <jeremie.galarneau@efficios.com>
+#
+# SPDX-License-Identifier: GPL-2.0-only
+
+from typing import Callable, Optional
+
+
+class _Logger:
+    def __init__(self, log: Optional[Callable[[str], None]]):
+        self._logging_function: Optional[Callable[[str], None]] = log
+
+    def _log(self, msg: str) -> None:
+        if self._logging_function:
+            self._logging_function(msg)
+
+    @property
+    def logger(self) -> Optional[Callable[[str], None]]:
+        return self._logging_function
This page took 0.024999 seconds and 4 git commands to generate.