Pudge 24 Posted November 10, 2021 Share Posted November 10, 2021 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. Link to comment https://wrobot.eu/forums/topic/13665-copy-log-to-desktop-code/ Share on other sites More sharing options...
Droidz 2766 Posted November 12, 2021 Share Posted November 12, 2021 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 { } } Pudge 1 Link to comment https://wrobot.eu/forums/topic/13665-copy-log-to-desktop-code/#findComment-64036 Share on other sites More sharing options...
Pudge 24 Posted November 15, 2021 Author Share Posted November 15, 2021 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 Link to comment https://wrobot.eu/forums/topic/13665-copy-log-to-desktop-code/#findComment-64053 Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now