public static void Validate(TraceKind value, string parameterValue) { if (!IsDefined(value)) { throw Error.InvalidEnumArgument(parameterValue, (int)value, typeof(TraceKind)); } }
public static void Validate(TraceKind value, string parameterValue) { if (!IsDefined(value)) { throw Error.InvalidEnumArgument(parameterValue, (int)value, typeof(TraceKind)); } }
public OneTrace(TraceKind traceKind, string str, int threadId, Ip ip) { TraceKind = traceKind; Str = str; ThreadId = threadId; Ip = ip; }
public OneTrace(TraceKind traceKind, string str, int threadId, Ip ip) { TraceKind = traceKind; Str = str; ThreadId = threadId; Ip = ip; }
public ExpectedTraceRecord(TraceKind kind, string category, string operatorName, string operationName) { TraceKind = kind; Category = category; OperatorName = operatorName; OperationName = operationName; }
//クライアント側への送信 public void AddTrace(TraceKind traceKind, string str, Ip ip) { if (!OpenTraceDlg) return; var threadId = GetCurrentThreadId(); var buffer = string.Format("{0}\b{1}\b{2}\b{3}", traceKind.ToString(), threadId.ToString(), ip, str); //トレース(S->C) RemoteData.Send(_sockTcp, RemoteDataKind.DatTrace, buffer); }
//トレースの追加(SockObj内から使用される) public void AddTrace(TraceKind traceKind, string str, Ip ip) { if (!Visible) return; var threadId = GetCurrentThreadId(); //トレースの追加(内部共通処理) lock (this) { _ar.Add(new OneTrace(traceKind, str, threadId, ip)); } }
//クライアント側への送信 public void AddTrace(TraceKind traceKind, string str, Ip ip) { if (!OpenTraceDlg) { return; } var threadId = GetCurrentThreadId(); var buffer = string.Format("{0}\b{1}\b{2}\b{3}", traceKind.ToString(), threadId.ToString(), ip, str); //トレース(S->C) RemoteData.Send(_sockTcp, RemoteDataKind.DatTrace, buffer); }
//トレースの追加(SockObj内から使用される) public void AddTrace(TraceKind traceKind, string str, Ip ip) { if (!Visible) { return; } var threadId = GetCurrentThreadId(); //トレースの追加(内部共通処理) lock (this) { _ar.Add(new OneTrace(traceKind, str, threadId, ip)); } }
internal PublishTimerObject(string eSpaceKey, string publishStep, bool fromSS, bool developmentMode, TraceKind traceKind, string extraInfo, string parentStep) { if (!eSpaceKey.IsNullOrEmpty()) { PublishTimerStart(eSpaceKey, publishStep, fromSS, developmentMode, traceKind, extraInfo, parentStep); this.publishStep = publishStep; this.eSpaceKey = eSpaceKey; this.fromSS = fromSS; this.developmentMode = developmentMode; this.traceKind = traceKind; this.extraInfo = extraInfo; this.parentStep = parentStep; } }
static Tracer() { TraceKind[] verbosityLevels = new TraceKind[10]; verbosityLevels[1] = TraceKind.Exception | TraceKind.Assert | TraceKind.Error | TraceKind.Warning | TraceKind.Message; verbosityLevels[2] = TraceKind.Exception | TraceKind.Assert | TraceKind.Error | TraceKind.Warning | TraceKind.Message; verbosityLevels[3] = TraceKind.Exception | TraceKind.Assert | TraceKind.Error | TraceKind.Warning | TraceKind.Message | TraceKind.Info; verbosityLevels[4] = TraceKind.Exception | TraceKind.Assert | TraceKind.Error | TraceKind.Warning | TraceKind.Message | TraceKind.Info; verbosityLevels[5] = TraceKind.Exception | TraceKind.Assert | TraceKind.Error | TraceKind.Warning | TraceKind.Message | TraceKind.Info; verbosityLevels[6] = TraceKind.Exception | TraceKind.Assert | TraceKind.Error | TraceKind.Warning | TraceKind.Message | TraceKind.Info | TraceKind.Note; verbosityLevels[7] = TraceKind.Exception | TraceKind.Assert | TraceKind.Error | TraceKind.Warning | TraceKind.Message | TraceKind.Info | TraceKind.Note; verbosityLevels[8] = TraceKind.Exception | TraceKind.Assert | TraceKind.Error | TraceKind.Warning | TraceKind.Message | TraceKind.Info | TraceKind.Note; verbosityLevels[9] = TraceKind.All; VerbosityLevels = verbosityLevels; _indentLevelStore = Thread.AllocateDataSlot(); _traceMask = (TraceKind)VerbosityLevels[1]; _tracers = new Dictionary<string, Tracer>(); }
static Tracer() { TraceKind[] verbosityLevels = new TraceKind[10]; verbosityLevels[1] = TraceKind.Exception | TraceKind.Assert | TraceKind.Error | TraceKind.Warning | TraceKind.Message; verbosityLevels[2] = TraceKind.Exception | TraceKind.Assert | TraceKind.Error | TraceKind.Warning | TraceKind.Message; verbosityLevels[3] = TraceKind.Exception | TraceKind.Assert | TraceKind.Error | TraceKind.Warning | TraceKind.Message | TraceKind.Info; verbosityLevels[4] = TraceKind.Exception | TraceKind.Assert | TraceKind.Error | TraceKind.Warning | TraceKind.Message | TraceKind.Info; verbosityLevels[5] = TraceKind.Exception | TraceKind.Assert | TraceKind.Error | TraceKind.Warning | TraceKind.Message | TraceKind.Info; verbosityLevels[6] = TraceKind.Exception | TraceKind.Assert | TraceKind.Error | TraceKind.Warning | TraceKind.Message | TraceKind.Info | TraceKind.Note; verbosityLevels[7] = TraceKind.Exception | TraceKind.Assert | TraceKind.Error | TraceKind.Warning | TraceKind.Message | TraceKind.Info | TraceKind.Note; verbosityLevels[8] = TraceKind.Exception | TraceKind.Assert | TraceKind.Error | TraceKind.Warning | TraceKind.Message | TraceKind.Info | TraceKind.Note; verbosityLevels[9] = TraceKind.All; VerbosityLevels = verbosityLevels; _indentLevelStore = Thread.AllocateDataSlot(); _traceMask = (TraceKind)VerbosityLevels[1]; _tracers = new Dictionary<string, Tracer>(); _tracersListSync = new RWObjectLocker(); GlobalData.Current.DanglingStaticDisposables.Add(typeof(Tracer)); }
private TraceItem StartTrace(TraceKind kind, PatternElement source) { TraceItem traceElement = new TraceItem { Kind = kind, PatternElement = source, State = TraceState.InProgress }; Items.Add(traceElement); if (!Tally.TryGetValue(source, out TallyEntry entry)) { entry = new TallyEntry { LastPosition = 0, Count = 0 }; Tally.Add(source, entry); } if (entry.LastPosition != State.Enumerator.Index) { entry.Count = 0; entry.LastPosition = State.Enumerator.Index; } entry.Count++; if (entry.Count > CycleThreshold) { throw new Exception("Possible cycle detected!"); } return(traceElement); }
public static void SetTraceLevel(int level) { _traceMask = VerbosityLevels[level]; }
public static bool IsDefined(TraceKind traceKind) { return(traceKind == TraceKind.Trace || traceKind == TraceKind.Begin || traceKind == TraceKind.End); }
public ITrace StartTrace(ITrace parent, TraceKind kind, IEnumerable <(string Name, string Value)> tags)
public ExpectedTraceRecord(TraceKind kind, string category, string operatorName, string operationName) { TraceKind = kind; Category = category; OperatorName = operatorName; OperationName = operationName; }
public ZipkinTrace(ZipkinTracer tracer, Trace trace, TraceKind traceKind) { Tracer = tracer; m_traceKind = traceKind; WrappedTrace = trace; }
public static bool IsDefined(TraceKind traceKind) { return traceKind == TraceKind.Trace || traceKind == TraceKind.Begin || traceKind == TraceKind.End; }
public string GetWithTwoEnumParameters([FromUri]TraceLevel level, TraceKind kind) { return level.ToString() + kind.ToString(); }
public string GetWithTwoEnumParameters([FromUri] TraceLevel level, TraceKind kind) { return(level.ToString() + kind.ToString()); }
/// <summary> /// Starts a new <see cref="ITrace"/> that is a child of <paramref name="trace"/>. /// </summary> /// <param name="trace">(Optional) The current trace. If this is <c>null</c>, this method returns <c>null</c>.</param> /// <param name="kind">The <see cref="TraceKind"/>.</param> /// <param name="tags">A sequence of span tags; see <see cref="ITrace.SetTag"/>.</param> /// <returns>A new <see cref="ITrace"/>, or <c>null</c>.</returns> public static ITrace StartChildTrace(this ITrace trace, TraceKind kind, IEnumerable <(string Name, string Value)> tags) =>
public static PublishTimerObject PublishTimer(string eSpaceKey, string publishStep, bool fromSS, bool developmentMode, TraceKind traceKind) { return(new PublishTimerObject(eSpaceKey, publishStep, fromSS, developmentMode, traceKind, /*extraInfo*/ "", /*parentStep*/ "")); }
public static void PublishTimerEnd(string eSpaceKey, string publishStep, bool fromSS, bool developmentMode, TraceKind traceKind, string extraInfo, string parentStep) { if (TimersActivated) { TimerEnd(publishStep); } if (CanLogPublishTrace(fromSS, developmentMode)) { DateTime currentDateTime = DateTime.Now; int milliseconds = currentDateTime.Millisecond; currentDateTime = new DateTime(currentDateTime.Year, currentDateTime.Month, currentDateTime.Day, currentDateTime.Hour, currentDateTime.Minute, currentDateTime.Second); PublishLog.LogPublishTrace(currentDateTime, milliseconds, eSpaceKey, publishStep, /*isStart*/ false, (int)traceKind, extraInfo, parentStep); } }
public LogItem(TraceKind traceKind, string text) { Text = text; TraceKind = traceKind; }
//バイナリデータであることが判明している場合は、noEncodeをtrueに設定する //これによりテキスト判断ロジックを省略できる protected void Trace(TraceKind traceKind, byte[] buf, bool noEncode) { if (buf == null || buf.Length == 0) { return; } if (Kernel.RunMode == RunMode.Remote) { return; //リモートクライアントの場合は、ここから追加されることはない } //Ver5.0.0-a22 サービス起動の場合は、このインスタンスは生成されていない bool enableDlg = Kernel.TraceDlg != null && Kernel.TraceDlg.Visible; if (!enableDlg && Kernel.RemoteConnect == null) { //どちらも必要ない場合は処置なし return; } bool isText = false; //対象がテキストかどうかの判断 Encoding encoding = null; if (!noEncode) { //エンコード試験が必要な場合 try{ encoding = MLang.GetEncoding(buf); } catch { encoding = null; } if (encoding != null) { //int codePage = encoding.CodePage; if (encoding.CodePage == 20127 || encoding.CodePage == 65001 || encoding.CodePage == 51932 || encoding.CodePage == 1200 || encoding.CodePage == 932 || encoding.CodePage == 50220) { //"US-ASCII" 20127 //"Unicode (UTF-8)" 65001 //"日本語(EUC)" 51932 //"Unicode" 1200 //"日本語(シフトJIS)" 932 //日本語(JIS) 50220 isText = true; } } } var ar = new List <String>(); if (isText) { var lines = Inet.GetLines(buf); ar.AddRange(lines.Select(line => encoding.GetString(Inet.TrimCrlf(line)))); } else { ar.Add(noEncode ? string.Format("binary {0} byte", buf.Length) : string.Format("Binary {0} byte", buf.Length)); } foreach (var str in ar) { Ip ip = RemoteIp; if (enableDlg) { //トレースダイアログが表示されてい場合、データを送る Kernel.TraceDlg.AddTrace(traceKind, str, ip); } if (Kernel.RemoteConnect != null) { //リモートサーバへもデータを送る(クライアントが接続中の場合は、クライアントへ送信される) Kernel.RemoteConnect.AddTrace(traceKind, str, ip); } } }
//バイナリデータであることが判明している場合は、noEncodeをtrueに設定する //これによりテキスト判断ロジックを省略できる protected void Trace(TraceKind traceKind, byte[] buf, bool noEncode) { if (buf == null || buf.Length == 0){ return; } if (Kernel.RunMode == RunMode.Remote){ return; //リモートクライアントの場合は、ここから追加されることはない } //Ver5.0.0-a22 サービス起動の場合は、このインスタンスは生成されていない bool enableDlg = Kernel.TraceDlg != null && Kernel.TraceDlg.Visible; if (!enableDlg && Kernel.RemoteConnect == null){ //どちらも必要ない場合は処置なし return; } bool isText = false; //対象がテキストかどうかの判断 Encoding encoding = null; if (!noEncode){ //エンコード試験が必要な場合 try{ encoding = MLang.GetEncoding(buf); } catch{ encoding = null; } if (encoding != null){ //int codePage = encoding.CodePage; if (encoding.CodePage == 20127 || encoding.CodePage == 65001 || encoding.CodePage == 51932 || encoding.CodePage == 1200 || encoding.CodePage == 932 || encoding.CodePage == 50220){ //"US-ASCII" 20127 //"Unicode (UTF-8)" 65001 //"日本語(EUC)" 51932 //"Unicode" 1200 //"日本語(シフトJIS)" 932 //日本語(JIS) 50220 isText = true; } } } var ar = new List<String>(); if (isText){ var lines = Inet.GetLines(buf); ar.AddRange(lines.Select(line => encoding.GetString(Inet.TrimCrlf(line)))); } else{ ar.Add(noEncode ? string.Format("binary {0} byte", buf.Length) : string.Format("Binary {0} byte", buf.Length)); } foreach (var str in ar){ Ip ip = RemoteIp; if (enableDlg){ //トレースダイアログが表示されてい場合、データを送る Kernel.TraceDlg.AddTrace(traceKind, str, ip); } if (Kernel.RemoteConnect != null){ //リモートサーバへもデータを送る(クライアントが接続中の場合は、クライアントへ送信される) Kernel.RemoteConnect.AddTrace(traceKind, str, ip); } } }
/// <summary> /// Starts a new trace (that is the root of a trace hierarchy). /// </summary> /// <param name="tracer">The <see cref="ITracer"/>.</param> /// <param name="kind">The <see cref="TraceKind"/>.</param> /// <param name="tags">A sequence of span tags; see <see cref="ITrace.SetTag"/>.</param> /// <returns>A new <see cref="ITrace"/>.</returns> public static ITrace StartNewTrace(this ITracer tracer, TraceKind kind, IEnumerable <(string Name, string Value)> tags) =>