mirror of
https://github.com/ayufan/steam-deck-tools.git
synced 2025-12-06 07:12:01 +01:00
27 lines
643 B
C#
27 lines
643 B
C#
using System.Diagnostics;
|
|
|
|
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)
|
|
{
|
|
if (!LogToTrace && !LogToConsole)
|
|
return;
|
|
|
|
String line = string.Format(format, arg);
|
|
if (LogToTrace)
|
|
Trace.WriteLine(line);
|
|
if (LogToConsole)
|
|
Console.WriteLine(line);
|
|
}
|
|
}
|
|
}
|