From 492ca388396d4a5f5afdf8dd565a70670ff965b4 Mon Sep 17 00:00:00 2001 From: Marc Hernandez Date: Sun, 5 May 2024 23:25:54 -0700 Subject: [PATCH] Cleanup x) Renames x) Better relativation --- imm/Imm.cs | 20 ++++++++++---------- logging/Log.cs | 9 +++++++-- res/Resource.cs | 2 +- ser/XmlFormatter2.cs | 2 +- 4 files changed, 19 insertions(+), 14 deletions(-) diff --git a/imm/Imm.cs b/imm/Imm.cs index 3c12630..f830c71 100644 --- a/imm/Imm.cs +++ b/imm/Imm.cs @@ -178,10 +178,10 @@ public record class Recorded : Versioned, imm.Imm [lib.Dont] public T? ZZOld { get; internal set; } public T? Old => ZZOld; - public string Expression { get; internal set; } = ""; - public string MemberName { get; internal set; } = ""; - public string FilePath { get; internal set; } = ""; - public int LineNumber { get; internal set; } = -1; + public string DbgName { get; internal set; } = ""; + public string DbgPath { get; internal set; } = ""; + public int DbgLine { get; internal set; } = -1; + public string DbgExp { get; internal set; } = ""; public MetaData() { } } @@ -245,9 +245,9 @@ public record class Recorded : Versioned, imm.Imm Reason = !string.IsNullOrWhiteSpace( reason ) ? reason : next.Meta.Reason, ZZOld = orig, - MemberName = dbgName, - FilePath = dbgPath, - LineNumber = dbgLine, + DbgName = dbgName, + DbgPath = dbgPath, + DbgLine = dbgLine, } }; @@ -355,9 +355,9 @@ public record class Timed : Recorded, imm.Imm Reason = !string.IsNullOrWhiteSpace( reason ) ? reason : next.Meta.Reason, //Recorded - MemberName = dbgName, - FilePath = dbgPath, - LineNumber = dbgLine, + DbgName = dbgName, + DbgPath = dbgPath, + DbgLine = dbgLine, ZZOld = orig, //Timed diff --git a/logging/Log.cs b/logging/Log.cs index bc821de..3ef2cb8 100644 --- a/logging/Log.cs +++ b/logging/Log.cs @@ -171,12 +171,14 @@ static public class log } */ + static string s_cwd = Directory.GetCurrentDirectory(); + static int s_cwdLength = s_cwd.Length; static public string relativePath( string fullPath ) { - var cwd = Directory.GetCurrentDirectory(); + if( fullPath.Length < s_cwdLength ) return fullPath; - var rel = fullPath.Substring( cwd.Length + 1 ); + var rel = fullPath.Substring( s_cwdLength + 1 ); return rel; } @@ -298,6 +300,9 @@ static public class log static void startup( string filename, Endpoints endpoints ) { + s_cwd = Directory.GetCurrentDirectory(); + s_cwdLength = s_cwd.Length; + s_endpoints = endpoints; var start = new ThreadStart( run ); diff --git a/res/Resource.cs b/res/Resource.cs index 795b2ae..970bb51 100644 --- a/res/Resource.cs +++ b/res/Resource.cs @@ -24,7 +24,7 @@ public interface Res_old [DebuggerDisplay("Path = {path}")] public class Ref : lib.I_Serialize { - static public bool s_verboseLogging = true; + static public bool s_verboseLogging = false; public string Filename =>path; diff --git a/ser/XmlFormatter2.cs b/ser/XmlFormatter2.cs index d17b0fb..ef93fb1 100644 --- a/ser/XmlFormatter2.cs +++ b/ser/XmlFormatter2.cs @@ -123,7 +123,7 @@ namespace lib public class XmlFormatter2Cfg : Config { - public bool VerboseLogging = true; + public bool VerboseLogging = false; public Datastructure datastructure = Datastructure.Tree;