-
-
Notifications
You must be signed in to change notification settings - Fork 18
Feature/#88027848 logging #26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Feature/#88027848 logging #26
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"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add unix time stamp
| 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 */ } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move down to the other fields, starting at line 81
| { | ||
| if (VideoNotFound) | ||
| { | ||
| //WHAT the Hell?? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Klappe 😾
| if (!validUri) | ||
| { | ||
| await RefreshResultsAsync(videolink.Clone() as string); | ||
| logger.LogWarning("InvalidUri in YouTubeDownloaderViewModel"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Log URL
| using Microsoft.UI.Windowing; | ||
| using Microsoft.UI.Composition.SystemBackdrops; | ||
| using System.Runtime.InteropServices; | ||
| using Microsoft.Extensions.Logging; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://youtu.be/2DpFbHYKERY?t=89
(timelink)
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.
No description provided.