aboutsummaryrefslogtreecommitdiff
path: root/lib/Utils/src/AdvancedTrace.cs
diff options
context:
space:
mode:
authorLibravatar vnugent <public@vaughnnugent.com>2024-03-31 17:00:45 -0400
committerLibravatar vnugent <public@vaughnnugent.com>2024-03-31 17:00:45 -0400
commit21130c889bd8564b201aa16c8f645abdf85d374a (patch)
tree57e685f0f7e5c341264eb890112de35206f3d289 /lib/Utils/src/AdvancedTrace.cs
parent55859158fbd0bf54473a0baeb486045a025c7c5d (diff)
Squashed commit of the following:
commit 448a93bb1d18d032087afe2476ffccb98634a54c Author: vnugent <public@vaughnnugent.com> Date: Sun Mar 31 16:56:51 2024 -0400 ci: fix third-party dir cleanup commit 9afed1427472da1ea13079f98dbe27339e55ee7d Author: vnugent <public@vaughnnugent.com> Date: Sun Mar 31 16:43:15 2024 -0400 perf: Deprecate unsafememoryhandle span extensions commit 3ff90da4f02af47ea6d233fdd4445337ebe36452 Author: vnugent <public@vaughnnugent.com> Date: Sat Mar 30 21:36:18 2024 -0400 refactor: Updates, advanced tracing, http optimizations commit 8d6b79b5ae309b36f265ba81529bcef8bfcd7414 Merge: 6c1667b 5585915 Author: vnugent <public@vaughnnugent.com> Date: Sun Mar 24 21:01:31 2024 -0400 Merge branch 'main' into develop commit 6c1667be23597513537f8190e2f55d65eb9b7c7a Author: vnugent <public@vaughnnugent.com> Date: Fri Mar 22 12:01:53 2024 -0400 refactor: Overhauled native library loading and lazy init commit ebf688f2f974295beabf7b5def7e6f6f150551d0 Author: vnugent <public@vaughnnugent.com> Date: Wed Mar 20 22:16:17 2024 -0400 refactor: Update compression header files and macros + Ci build commit 9c7b564911080ccd5cbbb9851a0757b05e1e9047 Author: vnugent <public@vaughnnugent.com> Date: Tue Mar 19 21:54:49 2024 -0400 refactor: JWK overhaul & add length getter to FileUpload commit 6d8c3444e09561e5957491b3cc1ae858e0abdd14 Author: vnugent <public@vaughnnugent.com> Date: Mon Mar 18 16:13:20 2024 -0400 feat: Add FNV1a software checksum and basic correction tests commit 00d182088cecefc08ca80b1faee9bed3f215f40b Author: vnugent <public@vaughnnugent.com> Date: Fri Mar 15 01:05:27 2024 -0400 chore: #6 Use utils filewatcher instead of built-in commit d513c10d9895c6693519ef1d459c6a5a76929436 Author: vnugent <public@vaughnnugent.com> Date: Sun Mar 10 21:58:14 2024 -0400 source tree project location updated
Diffstat (limited to 'lib/Utils/src/AdvancedTrace.cs')
-rw-r--r--lib/Utils/src/AdvancedTrace.cs52
1 files changed, 52 insertions, 0 deletions
diff --git a/lib/Utils/src/AdvancedTrace.cs b/lib/Utils/src/AdvancedTrace.cs
new file mode 100644
index 0000000..0507089
--- /dev/null
+++ b/lib/Utils/src/AdvancedTrace.cs
@@ -0,0 +1,52 @@
+/*
+* Copyright (c) 2024 Vaughn Nugent
+*
+* Library: VNLib
+* Package: VNLib.Utils
+* File: AdvancedTrace.cs
+*
+* AdvancedTrace.cs is part of VNLib.Utils which is part of the larger
+* VNLib collection of libraries and utilities.
+*
+* VNLib.Utils is free software: you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published
+* by the Free Software Foundation, either version 2 of the License,
+* or (at your option) any later version.
+*
+* VNLib.Utils is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with VNLib.Utils. If not, see http://www.gnu.org/licenses/.
+*/
+
+using System.Diagnostics;
+
+namespace VNLib.Utils
+{
+ /// <summary>
+ /// Provides methods for advanced tracing that are only optionally compiled
+ /// with the VNLIB_ADVANCED_TRACING symbol defined
+ /// </summary>
+ internal static class AdvancedTrace
+ {
+ const string AdvancedTraceSymbol = "VNLIB_ADVANCED_TRACING";
+
+ [Conditional(AdvancedTraceSymbol)]
+ public static void WriteLine(string? message) => Trace.WriteLine(message);
+
+ [Conditional(AdvancedTraceSymbol)]
+ public static void WriteLine(string? message, string? category) => Trace.WriteLine(message, category);
+
+ [Conditional(AdvancedTraceSymbol)]
+ public static void WriteLineIf(bool condition, string? message) => Trace.WriteLineIf(condition, message);
+
+ [Conditional(AdvancedTraceSymbol)]
+ public static void WriteLineIf(bool condition, string? message, string? category) => Trace.WriteLineIf(condition, message, category);
+
+ [Conditional(AdvancedTraceSymbol)]
+ public static void WriteLine(object? value) => Trace.WriteLine(value);
+ }
+} \ No newline at end of file