public static string Header(string product, Exception ex) { string[] r = new string[] { "Product:" + product, "Exception:" + (ex != null ? ex.Message : "n/a"), "StackTrace:" + (ex != null ? ex.StackTrace : "n/a"), "CommandLine:" + Environment.CommandLine, "OS:" + Environment.OSVersion.VersionString + " " + (IntPtr.Size * 8).ToString() + "bit", "CLR:" + Environment.Version.ToString(4), "TradeLink:" + TradeLink.Common.Util.TLSIdentity(), "Memory:" + Environment.WorkingSet.ToString(), "Processors:" + Environment.ProcessorCount.ToString(), "MID:" + Auth.GetNetworkAddress(), "Date/Time: " + TradeLink.Common.Util.ToTLDate() + "/" + TradeLink.Common.Util.ToTLTime(), "Culture: " + System.Globalization.CultureInfo.CurrentCulture.EnglishName }; string desc = LINE + string.Join(Environment.NewLine, r) + LINE; return(desc); }
/// <summary> /// track an event with custom data /// </summary> /// <param name="type"></param> /// <param name="data"></param> public void Track(TrackType type, string data) { // get clicked item name Track t = new Track(type, data); t.id = Auth.GetNetworkAddress(); t.tag = Program; debug(_tc.ToString() + " " + t.ToString()); if (SendTrackEvent != null) { SendTrackEvent(t); } if (!TrackEnabled) { return; } _tc++; _untrackedqueue.Write(t); }
static string DecodedBody(string program, Exception ex, string data, bool addtemplate) { string[] r = new string[] { (addtemplate ? template() : string.Empty), "App:" + program, "Err:" + (ex != null ? ex.Message : "n/a"), "Trace:" + (ex != null ? ex.StackTrace : "n/a"), "OS:" + Environment.OSVersion.VersionString + " " + (IntPtr.Size * 8).ToString() + "bit", "CLR:" + Environment.Version.ToString(4), "TL:" + TradeLink.Common.Util.TLSIdentity(), "Mem:" + Environment.WorkingSet.ToString(), "Proc:" + Environment.ProcessorCount.ToString(), "MID:" + Auth.GetNetworkAddress(), "Date/Time: " + Util.ToTLDate() + "/" + Util.ToTLTime(), "Culture: " + System.Globalization.CultureInfo.CurrentCulture.EnglishName, data }; string decoded = string.Join(Environment.NewLine, r); return(decoded); }
/// <summary> /// see if we're authorized on this machine /// </summary> /// <returns></returns> public bool isAuthorized() { return(isAuthorized(Auth.GetNetworkAddress())); }
/// <summary> /// get a formatted description of information about this machine /// </summary> /// <param name="space"></param> /// <param name="program"></param> /// <param name="ex"></param> /// <returns></returns> public static string TicketContext(string space, string program, Exception ex) { string[] r = new string[] { "Product:" + space, "Program:" + program, "Exception:" + (ex != null ? ex.Message : "n/a"), "StackTrace:" + (ex != null ? ex.StackTrace : "n/a"), "CommandLine:" + Environment.CommandLine, "OS:" + Environment.OSVersion.VersionString + " " + (IntPtr.Size * 8).ToString() + "bit", "CLR:" + Environment.Version.ToString(4), "TradeLink:" + TradeLink.Common.Util.TLSIdentity(), "Memory:" + Environment.WorkingSet.ToString(), "Processors:" + Environment.ProcessorCount.ToString(), "MID: " + Auth.GetNetworkAddress() }; string desc = string.Join(Environment.NewLine, r); return(desc); }