Feature/#88027848 logging#26
Open
LorenzOnionware wants to merge 11 commits intoonionware-github:mainfrom
Open
Conversation
-Log path moved to documents -custom days for deleting logs -open path right from the Settings
…feature/#88027848-Logging
| sealed partial class ServiceProvider { } No newline at end of file | ||
| sealed partial class ServiceProvider | ||
| { | ||
| private static string logfile = Path.Combine(AppSettings.Instance.LogPath, $"{DateTime.Now:yyyy-MM-dd_HH-mm-ss}.log"); |
Owner
There was a problem hiding this comment.
Add unix time stamp
Suggested change
| private static string logfile = Path.Combine(AppSettings.Instance.LogPath, $"{DateTime.Now:yyyy-MM-dd_HH-mm-ss}.log"); | |
| private static string logfile = Path.Combine(AppSettings.Instance.LogPath, $"{DateTime.Now:yyyy-MM-dd_HH-mm-ss}_{DateTimeOffset.UtcNow.ToUnixTimeSeconds()}.log"); |
| { | ||
| try { Directory.Delete(dir, true); } | ||
| catch { /* Dont crash if a directory cant be deleted */ } | ||
| catch { logger.LogInformation("Directory cant be deleted in DownloadVideosAsync");/* Dont crash if a directory cant be deleted */ } |
Owner
There was a problem hiding this comment.
Which directory is affected? Add dir to log.
| this.dispatcher = dispatcher ?? throw new ArgumentNullException(nameof(dispatcher)); | ||
| this.taskbarProgressService = taskbarProgressService; | ||
| this.versionService = versionService; | ||
| logger.LogDebug(GetVersionDescription()); |
Owner
There was a problem hiding this comment.
The version has nothing to do with the MediaViewModel. In addition, the MediaViewModel isn't always called, the app can also start on the downloader page.
Move it somewhere more generic, like the app initialization code file (maybe Program.cs).
| { | ||
| public YouTubeDownloaderViewModel(IDialogService dialogService, IDownloaderDialogService downloaderDialogService, IDispatcherService dispatcher, INetworkStatusService networkStatusService, IToastNotificationService toastNotificationService, IPathProvider pathProvider, ITaskbarProgressService taskbarProgressService, IWindowClosingService windowClosingService, IFiletagEditorDialog filetagDialogService) | ||
| { | ||
| public ILogger<YouTubeDownloaderViewModel> logger; |
Owner
There was a problem hiding this comment.
Move down to the other fields, starting at line 81
| { | ||
| if (VideoNotFound) | ||
| { | ||
| //WHAT the Hell?? |
| if (!validUri) | ||
| { | ||
| await RefreshResultsAsync(videolink.Clone() as string); | ||
| logger.LogWarning("InvalidUri in YouTubeDownloaderViewModel"); |
| using Microsoft.UI.Windowing; | ||
| using Microsoft.UI.Composition.SystemBackdrops; | ||
| using System.Runtime.InteropServices; | ||
| using Microsoft.Extensions.Logging; |
Owner
There was a problem hiding this comment.
What did you changed in this code file?
If no changes, revert.
|
|
||
| namespace OnionMedia.Services | ||
| { | ||
| //Why does a programmer code in java? Because he can´t see sharp. rofl |
Co-authored-by: Jaden <91136545+onionware-github@users.noreply.github.com>
Co-authored-by: Jaden <91136545+onionware-github@users.noreply.github.com>
…feature/#88027848-Logging
All downlaods are logged now.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.