From fbd45f1763ac643097f44d1482b9aae3a36f68e0 Mon Sep 17 00:00:00 2001 From: "Tristan B. Velloza Kildaire" Date: Wed, 1 Mar 2023 10:17:04 +0200 Subject: [PATCH] Core - Fixed bug whereby the meta programming was only enabled during `unittest` build mode --- source/dlog/core.d | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/source/dlog/core.d b/source/dlog/core.d index 67c9d31..d1b743a 100644 --- a/source/dlog/core.d +++ b/source/dlog/core.d @@ -104,14 +104,15 @@ public class Logger { /* Default context extras ios nothing */ string[] contextExtras = null; - version(unittest) + static if(__traits(isSame, typeof(message[$-1]), mixin(`string[]`))) { - static if(__traits(isSame, typeof(message[$-1]), mixin(`string[]`))) + contextExtras = message[$-1]; + version(unittest) { - contextExtras = message[$-1]; pragma(msg, "meta: log: Found a custom string[] context array"); } } + /* Construct context array */ string[] context = [c1, c2, to!(string)(c3), c4, c5, c6]~contextExtras;