diff options
| author | Roy Ben-Shabat <Roy@Twine-s.com> | 2018-04-15 19:51:07 +0300 |
|---|---|---|
| committer | Roy Ben-Shabat <Roy@Twine-s.com> | 2018-04-15 19:51:07 +0300 |
| commit | ca293b80c52a54c73251fbf3cd50741fb5653ae9 (patch) | |
| tree | f1168fa167a26bf8455e601291b8a19945a70187 /Software/Visual_Studio/Tango.Logging/LogItemBase.cs | |
| parent | 9ff8293b603f72c5faa8d238b3005524c31cc5a8 (diff) | |
| download | Tango-ca293b80c52a54c73251fbf3cd50741fb5653ae9.tar.gz Tango-ca293b80c52a54c73251fbf3cd50741fb5653ae9.zip | |
Lots Of Work !
Diffstat (limited to 'Software/Visual_Studio/Tango.Logging/LogItemBase.cs')
| -rw-r--r-- | Software/Visual_Studio/Tango.Logging/LogItemBase.cs | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/Software/Visual_Studio/Tango.Logging/LogItemBase.cs b/Software/Visual_Studio/Tango.Logging/LogItemBase.cs index 85451488a..6b282b6ab 100644 --- a/Software/Visual_Studio/Tango.Logging/LogItemBase.cs +++ b/Software/Visual_Studio/Tango.Logging/LogItemBase.cs @@ -11,6 +11,13 @@ namespace Tango.Logging /// </summary> public abstract class LogItemBase { + private static String base_path; + + /// <summary> + /// Gets or sets the assembly. + /// </summary> + public String CallerAssembly { get; set; } + /// <summary> /// Gets or sets the caller method adding the exception. /// </summary> @@ -39,12 +46,23 @@ namespace Tango.Logging /// <summary> /// Gets the log message. /// </summary> - /// <returns></returns> - public abstract String GetMessage(); + public abstract String Message { get; set; } /// <summary> /// Returns a formatted string of the log item. /// </summary> public abstract override String ToString(); + + protected String GetRelativeCallerFilePath() + { + if (base_path == null) + { + int index = CallerFile.IndexOf("Visual_Studio") + "Visual_Studio".Length + 1; + String relative = CallerFile.Substring(index, CallerFile.Length - index); + base_path = CallerFile.Replace(relative, ""); + } + + return CallerFile.Replace(base_path, ""); + } } } |
