diff options
| author | Roy Ben-Shabat <Roy@Twine-s.com> | 2018-04-16 17:45:25 +0300 |
|---|---|---|
| committer | Roy Ben-Shabat <Roy@Twine-s.com> | 2018-04-16 17:45:25 +0300 |
| commit | e66cd269ad02302f2a5a4ec377112cd61789647e (patch) | |
| tree | 3f229e2460a16e3b3383cb39e7458a19469553d2 /Software/Visual_Studio/Tango.Logging/LogItemBase.cs | |
| parent | 53f93d7fd2d2aa4571bad6e93e0c519fce242753 (diff) | |
| download | Tango-e66cd269ad02302f2a5a4ec377112cd61789647e.tar.gz Tango-e66cd269ad02302f2a5a4ec377112cd61789647e.zip | |
Application Logs & Embedded Logs on Logging Module!
Diffstat (limited to 'Software/Visual_Studio/Tango.Logging/LogItemBase.cs')
| -rw-r--r-- | Software/Visual_Studio/Tango.Logging/LogItemBase.cs | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/Software/Visual_Studio/Tango.Logging/LogItemBase.cs b/Software/Visual_Studio/Tango.Logging/LogItemBase.cs index 6b282b6ab..720de0905 100644 --- a/Software/Visual_Studio/Tango.Logging/LogItemBase.cs +++ b/Software/Visual_Studio/Tango.Logging/LogItemBase.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; @@ -53,6 +54,10 @@ namespace Tango.Logging /// </summary> public abstract override String ToString(); + /// <summary> + /// Gets the relative caller file path. + /// </summary> + /// <returns></returns> protected String GetRelativeCallerFilePath() { if (base_path == null) @@ -62,7 +67,14 @@ namespace Tango.Logging base_path = CallerFile.Replace(relative, ""); } - return CallerFile.Replace(base_path, ""); + if (Path.IsPathRooted(CallerFile)) + { + return CallerFile.Remove(0, base_path.Length); + } + else + { + return CallerFile; + } } } } |
