mirror of
https://github.com/ayufan/steam-deck-tools.git
synced 2026-03-10 06:53:57 +01:00
Do not log to Trace in DEBUG
This commit is contained in:
parent
7bb6aa0460
commit
7c559e58f7
|
|
@ -4,12 +4,22 @@ namespace CommonHelpers
|
|||
{
|
||||
public static class Log
|
||||
{
|
||||
#if DEBUG
|
||||
private static bool LogToTrace = true;
|
||||
#else
|
||||
private static bool LogToTrace = false;
|
||||
#endif
|
||||
private static bool LogToConsole = Environment.UserInteractive;
|
||||
|
||||
public static void TraceLine(string format, params object?[] arg)
|
||||
{
|
||||
String line = string.Format(format, arg);
|
||||
if (!LogToTrace && !LogToConsole)
|
||||
return;
|
||||
|
||||
Trace.WriteLine(line);
|
||||
if (Environment.UserInteractive)
|
||||
String line = string.Format(format, arg);
|
||||
if (LogToTrace)
|
||||
Trace.WriteLine(line);
|
||||
if (LogToConsole)
|
||||
Console.WriteLine(line);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue