Skip to content

Comments

137 export functionality#144

Merged
boexler merged 10 commits intomasterfrom
137-export-functionality
Feb 2, 2026
Merged

137 export functionality#144
boexler merged 10 commits intomasterfrom
137-export-functionality

Conversation

@boexler
Copy link
Owner

@boexler boexler commented Feb 2, 2026

No description provided.

- Add ExportParameter model with ExportFormat enum

- Add ExportCommand to NLogViewer for exporting filtered log entries

- Add ExportLogsCommand to MainViewModel with SaveFileDialog integration

- Add Logs -> Export menu item with automatic enable/disable based on tab selection

- Add localization resources for export menu items in all supported languages

- Export format: yyyy-MM-dd HH:mm:ss.ffff | LEVEL | LoggerName | Message

- Default filename: {TabHeader}-{Timestamp}.log
- Add support for pipe-separated log format (timestamp | level | logger | message)
- Add multi-line message support with continuation line detection
- Add ISO 8601 UTC timestamp formats with 'Z' suffix
- Extend all tests to verify TimeStamp, LogLevel, LoggerName, and Message
Expose ScrollToEndCommand on NLogViewer, wire NLogViewer reference into LogTabViewModel via DataContext, and trigger scroll after adding log events when AutoScroll is enabled.
…get DP

- Add ICacheTarget with Cache (IObservable<LogEventInfo>); CacheTarget implements it.

- LogTabViewModel implements ICacheTarget, exposes Cache; remove NLogViewer and LogEventInfos.

- NLogViewer: add CacheTarget dependency property; OnCacheTargetChanged calls StartListen(target).

- StartListen(ICacheTarget?) accepts optional target; fallback to GetInstance(TargetName).

- MainViewModel: remove scroll-to-end logic that referenced tab.NLogViewer.
Implement ReplaySubject in LogTabViewModel so events are held until NLogViewer subscribes. Bind NLogViewer via CacheTarget instead of ItemsSource. Push events via AddLogEvent from MainViewModel. Add System.Reactive to App project.
Remove ItemsSource dependency property and related handlers. Log events are supplied only via CacheTarget (CacheTargetProperty when set, else CacheTarget.GetInstance). Update comments to describe CacheTarget-based data source and simplify OnPauseChanged, StartListen, ClearCommand, and Loaded logic.
Replace ReplaySubject with Defer+Concat+Publish+RefCount so the first
subscriber receives buffered events and later subscribers receive only
events from subscription time. AddLogEvent fills a buffer until first
connect, then routes to a live Subject. Thread-safe via lock.
… compatibility

NLogViewer no longer requires a parent Window; uses Application.Current.Dispatcher or Dispatcher.CurrentDispatcher when Window.GetWindow returns null.

Add TestCacheTarget (ICacheTarget test double) and WpfTestHelper.CreateViewerWithTestData/WaitForViewerEvents. Refactor NLogViewerFilterTests to use CreateViewerWithTestData so tests exercise the real cache subscription path.
…ch failures

NLogViewerFilterTests passed individually but failed when run together because later tests used Application.Current.Dispatcher from the first test's (dead) STA thread. Use a single STA thread and WPF Application for all filter tests via WpfStaContextFixture and IClassFixture. Simplify WpfTestHelper (remove RunOnStaThread; use StartListen in CreateViewerWithTestData). Remove unused usings in test files.
@boexler boexler linked an issue Feb 2, 2026 that may be closed by this pull request
8 tasks
@boexler boexler merged commit b2d0ea7 into master Feb 2, 2026
2 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Export Functionality

1 participant