summaryrefslogtreecommitdiff
path: root/trace/root.ha
diff options
context:
space:
mode:
Diffstat (limited to 'trace/root.ha')
-rw-r--r--trace/root.ha21
1 files changed, 21 insertions, 0 deletions
diff --git a/trace/root.ha b/trace/root.ha
new file mode 100644
index 0000000..dbae0d1
--- /dev/null
+++ b/trace/root.ha
@@ -0,0 +1,21 @@
+use fmt;
+
+export let root = tracer {
+ log = &root_log,
+};
+
+let cur_root = &silent;
+
+export fn setroot(tr: *tracer) void = {
+ cur_root = tr;
+};
+
+fn root_log(
+ tr: *tracer,
+ ctx: nullable *context,
+ lvl: level,
+ fmt: str,
+ fields: fmt::field...
+) void = {
+ log(cur_root, ctx, lvl, fmt, fields...);
+};