public void SelectTarget(Target target) { if (!_config.AllTargets.Contains(target)) { throw new ArgumentException("Config doesnt contain selected target"); } if (target is FileTarget layoutTarget && layoutTarget.Layout is JsonLayout layout) { _connection = new JsonFileConnection(GetFilePath(layoutTarget), layout); _connection.MaxIndexChanged += () => MaxIndexChanged?.Invoke(); _connection.CacheAll(); _connection.BeginWatch(); SourceConnected?.Invoke(); } }
internal void CloseLog() { _connection.Close(); _connection = null; SourceDisconnected?.Invoke(); }