November 10, 20214 yr Hey all, who know how you can call this method, using code? Often there is some kind of error in the code, but by the time it is detected, the bot has already closed, and it becomes difficult to find the required log file in the "Logs" folder, when there are thousands of them, if you knew how to call this method, you could make a plugin, allowing you to copy the log when certain errors occur, this would be very useful.
November 12, 20214 yr Hi, it is code: private void ButtonCopyLog(object sender, System.Windows.RoutedEventArgs e) { try { var logFilePath = $@"{Others.GetCurrentDirectory}\Logs\{Logging.NameCurrentLogFile()}"; var logCopyDest = $@"{Environment.GetFolderPath(Environment.SpecialFolder.DesktopDirectory)}\{Logging.NameCurrentLogFile()}"; if (File.Exists(logCopyDest)) File.Delete(logCopyDest); File.Copy(logFilePath, logCopyDest); Logging.Write("[Logging]" + Logging.NameCurrentLogFile() + " copied on your desktop."); } catch { } }
November 15, 20214 yr Author On 11/12/2021 at 2:53 PM, Droidz said: Hi, it is code: private void ButtonCopyLog(object sender, System.Windows.RoutedEventArgs e) { try { var logFilePath = $@"{Others.GetCurrentDirectory}\Logs\{Logging.NameCurrentLogFile()}"; var logCopyDest = $@"{Environment.GetFolderPath(Environment.SpecialFolder.DesktopDirectory)}\{Logging.NameCurrentLogFile()}"; if (File.Exists(logCopyDest)) File.Delete(logCopyDest); File.Copy(logFilePath, logCopyDest); Logging.Write("[Logging]" + Logging.NameCurrentLogFile() + " copied on your desktop."); } catch { } } Thank you very much, this is what I need
Create an account or sign in to comment