* using .Net framework version 4.6.1 in all projects * implemented exception handling in VCFileWrapperFactory * moved logging in separate assembly * enabled logging in wrapper code
41 lines
1.1 KiB
C#
41 lines
1.1 KiB
C#
using System.Runtime.CompilerServices;
|
|
|
|
namespace CoatiSoftware.SourcetrailPlugin.Logging
|
|
{
|
|
public class Logging
|
|
{
|
|
public static void LogInfo(string message, [CallerFilePath] string file = "", [CallerMemberName] string member = "", [CallerLineNumber] int line = 0)
|
|
{
|
|
int idx = file.LastIndexOf('\\');
|
|
if(idx > -1)
|
|
{
|
|
file = file.Substring(idx + 1);
|
|
}
|
|
|
|
LogManager.GetInstance().LogInfo(message, file, member, line);
|
|
}
|
|
|
|
public static void LogWarning(string message, [CallerFilePath] string file = "", [CallerMemberName] string member = "", [CallerLineNumber] int line = 0)
|
|
{
|
|
int idx = file.LastIndexOf('\\');
|
|
if (idx > -1)
|
|
{
|
|
file = file.Substring(idx + 1);
|
|
}
|
|
|
|
LogManager.GetInstance().LogWarning(message, file, member, line);
|
|
}
|
|
|
|
public static void LogError(string message, [CallerFilePath] string file = "", [CallerMemberName] string member = "", [CallerLineNumber] int line = 0)
|
|
{
|
|
int idx = file.LastIndexOf('\\');
|
|
if (idx > -1)
|
|
{
|
|
file = file.Substring(idx + 1);
|
|
}
|
|
|
|
LogManager.GetInstance().LogError(message, file, member, line);
|
|
}
|
|
}
|
|
}
|