- Add EchoType to TextInjectionMode enum (becomes default) - Add WriteToEchoTypePipe(): write [UINT32 cch][WCHAR text] to \.\pipe\EchoType\pid_<PID> via NamedPipeClientStream - InsertText(): route to EchoType pipe when mode is EchoType - TrayApplicationContext: add 'EchoType (recommended)' to input mode menu - Update tray branding: 'EchoType Bridge' in tooltips and balloon tips - AppLogger: log to %LocalAppData%\EchoType\bridge.log The bridge keeps WebSocket server + UDP discovery + audio control unchanged. Text injection now goes through the EchoType TIP's composition-commit mechanism for atomic insertion, falling back to clipboard and SendInput as secondary options. Co-Authored-By: Claude <noreply@anthropic.com>
33 lines
996 B
C#
33 lines
996 B
C#
namespace WirelessTextSyncer.Windows.Services;
|
|
|
|
public static class AppLogger
|
|
{
|
|
private static readonly object SyncRoot = new();
|
|
private static readonly string LogDirectory = Path.Combine(
|
|
Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData),
|
|
"EchoType");
|
|
|
|
public static string LogPath => Path.Combine(LogDirectory, "bridge.log");
|
|
|
|
public static void Info(string message)
|
|
{
|
|
Write("INFO", message);
|
|
}
|
|
|
|
public static void Error(string message, Exception? exception = null)
|
|
{
|
|
Write("ERROR", exception is null ? message : $"{message}{Environment.NewLine}{exception}");
|
|
}
|
|
|
|
private static void Write(string level, string message)
|
|
{
|
|
lock (SyncRoot)
|
|
{
|
|
Directory.CreateDirectory(LogDirectory);
|
|
File.AppendAllText(
|
|
LogPath,
|
|
$"{DateTimeOffset.Now:yyyy-MM-dd HH:mm:ss.fff zzz} [{level}] {message}{Environment.NewLine}");
|
|
}
|
|
}
|
|
}
|