FindMyFiles

FindMyFiles.Services

FileLog Class

Zero-dependency file logger for the app process. Covers everything on the C# side; the log directory is resolved by AppPaths (portable <exe>\data\logs by default, else %APPDATA%\find-my-files\logs) — the same dir the scope engine logs into. Thread-safe, single rotation generation.

public static class FileLog

Inheritance System.Object → FileLog

Properties

FileLog.CrashMarkerPath Property

Absolute path to the crash marker dropped on a fatal exit and read back on the next launch (see WriteCrashMarker(string) / TakeCrashMarker()).

public static string CrashMarkerPath { get; }

Property Value

System.String

FileLog.LogPath Property

Absolute path to the active log file (…\logs\app.log under the resolved data root) — surfaced for the diagnostics "open log folder" affordance.

public static string LogPath { get; }

Property Value

System.String

Methods

FileLog.Error(string, string, Exception) Method

Log an error under area, optionally appending the full ex for the stack trace.

public static void Error(string area, string message, System.Exception? ex=null);

Parameters

area System.String

Subsystem tag.

message System.String

The message text.

ex System.Exception

Optional exception to append verbatim.

FileLog.Info(string, string) Method

Log an informational line under area (the subsystem tag shown in brackets).

public static void Info(string area, string message);

Parameters

area System.String

Subsystem tag, e.g. "notify" or "settings".

message System.String

The message text.

FileLog.Tail(int) Method

Last `lines` of the log — for the diagnostics clipboard dump.

public static string Tail(int lines);

Parameters

lines System.Int32

How many trailing lines to return.

Returns

System.String
The joined tail, or a placeholder if missing/unreadable.

FileLog.TakeCrashMarker() Method

Returns and clears the crash marker from the previous run.

public static string? TakeCrashMarker();

Returns

System.String
The marker contents, or null if absent or unreadable.

FileLog.Warn(string, string, Exception) Method

Log a warning under area, optionally appending the full ex for the stack trace.

public static void Warn(string area, string message, System.Exception? ex=null);

Parameters

area System.String

Subsystem tag.

message System.String

The message text.

ex System.Exception

Optional exception to append verbatim.

FileLog.WriteCrashMarker(string) Method

Drop a crash marker (timestamp + detail) so the next launch can detect an abnormal exit and offer to report it. Best-effort; failures are swallowed.

public static void WriteCrashMarker(string detail);

Parameters

detail System.String

Crash context to record alongside the timestamp.