diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 00:47:55 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 00:47:55 +0000 |
commit | 26a029d407be480d791972afb5975cf62c9360a6 (patch) | |
tree | f435a8308119effd964b339f76abb83a57c29483 /testing/raptor/logger/logger.py | |
parent | Initial commit. (diff) | |
download | firefox-26a029d407be480d791972afb5975cf62c9360a6.tar.xz firefox-26a029d407be480d791972afb5975cf62c9360a6.zip |
Adding upstream version 124.0.1.upstream/124.0.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'testing/raptor/logger/logger.py')
-rw-r--r-- | testing/raptor/logger/logger.py | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/testing/raptor/logger/logger.py b/testing/raptor/logger/logger.py new file mode 100644 index 0000000000..7e5f3b6f8d --- /dev/null +++ b/testing/raptor/logger/logger.py @@ -0,0 +1,51 @@ +#!/usr/bin/env python + +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. + +from mozlog.proxy import ProxyLogger + + +class RaptorLogger: + app = "" + + def __init__(self, component=None): + self.logger = ProxyLogger(component) + + def set_app(self, app_name): + """Sets the app name to prefix messages with.""" + RaptorLogger.app = " [" + app_name + "]" + + def exception(self, message, **kwargs): + self.critical(message, **kwargs) + + def debug(self, message, **kwargs): + return self.logger.debug("Debug: {}".format(message), **kwargs) + + def info(self, message, **kwargs): + return self.logger.info("Info: {}".format(message), **kwargs) + + def warning(self, message, **kwargs): + return self.logger.warning( + "Warning:{} {}".format(RaptorLogger.app, message), **kwargs + ) + + def error(self, message, **kwargs): + return self.logger.error( + "Error:{} {}".format(RaptorLogger.app, message), **kwargs + ) + + def critical(self, message, **kwargs): + return self.logger.critical( + "Critical:{} {}".format(RaptorLogger.app, message), **kwargs + ) + + def log_raw(self, message, **kwargs): + return self.logger.log_raw(message, **kwargs) + + def process_output(self, *args, **kwargs): + return self.logger.process_output(*args, **kwargs) + + def crash(self, *args, **kwargs): + return self.logger.crash(*args, **kwargs) |