Index: Tools/Scripts/webkitpy/thirdparty/wpt/wpt/tools/wptserve/wptserve/logger.py |
diff --git a/Tools/Scripts/webkitpy/thirdparty/wpt/wpt/tools/wptserve/wptserve/logger.py b/Tools/Scripts/webkitpy/thirdparty/wpt/wpt/tools/wptserve/wptserve/logger.py |
new file mode 100644 |
index 0000000000000000000000000000000000000000..6c91492c7e9a9d752be40c474d51245975f6b1ff |
--- /dev/null |
+++ b/Tools/Scripts/webkitpy/thirdparty/wpt/wpt/tools/wptserve/wptserve/logger.py |
@@ -0,0 +1,29 @@ |
+class NoOpLogger(object): |
+ def critical(self, msg): |
+ pass |
+ |
+ def error(self, msg): |
+ pass |
+ |
+ def info(self, msg): |
+ pass |
+ |
+ def warning(self, msg): |
+ pass |
+ |
+ def debug(self, msg): |
+ pass |
+ |
+logger = NoOpLogger() |
+_set_logger = False |
+ |
+def set_logger(new_logger): |
+ global _set_logger |
+ if _set_logger: |
+ raise Exception("Logger must be set at most once") |
+ global logger |
+ logger = new_logger |
+ _set_logger = True |
+ |
+def get_logger(): |
+ return logger |