public static void Exception(Exception ex, string description = null, params object[] args) { if (description != null) { if (Hide.HasFlag(LogLevel.Exception)) { description += " See log file for more details."; } WriteLine(LogLevel.Error, description, args); } WriteLine(LogLevel.Exception, ex.ToString()); #if !DEBUG if (!File.Exists(Log.LogFile)) { return; } Console.WriteLine("Press any key to upload files to pastebin"); Console.ReadKey(); var url = PastebinApi.Publish(File.ReadAllText(Log.LogFile)); Console.WriteLine($"Your logfile has been uploaded to: {url}"); #endif }
public static string Publish(string text) { var client = new PastebinApi(); var date = DateTime.Now; var entry = new PastebinEntry { Title = $"DCNC Crash report {date.Month}/{date.Day}/{date.Year} {date.Hour}:{date.Minute}:{date.Second}", Text = text, Expiration = PasteBinExpiration.OneMonth, Private = false, Format = "csharp" }; string pasteUrl = client.Paste(entry); return(pasteUrl); }