EZTraceLog 1.0.0

Easy Trace Log

Install-Package EZTraceLog -Version 1.0.0
dotnet add package EZTraceLog --version 1.0.0
<PackageReference Include="EZTraceLog" Version="1.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add EZTraceLog --version 1.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

Sample

// set the log file path and file Name
TraceLog.SetLogFile("D:\AppData\Log"), "TestLogConsole");

TraceLog.InfoWrite("main", "Start Process");

TraceLog.DebugWrite("methodName", "This is debug log");

TraceLog.WarnWrite("className", "This is warn log");

TraceLog.ErrorWrite("canTypeAnything", "This is error log");

TraceLog.InfoWrite("main", "End Process");

Result

D:\AppData\Log\TestLogConsole.2018-06-11.log

17:22:45.670 [main      ][INFO ] Start Process
17:22:45.671 [methodName][DEBUG] This is debug log
17:22:45.671 [className ][WARN ] This is warn log
17:22:45.671 [canTypeAnything][ERROR] This is error log
17:22:45.671 [main      ][INFO ] End Process

You can send error message when ErrorWrite

public interface IMsgSender
{
	bool Send(string title, string message);
}

public class MySmtpSender : IMsgSender
{
	public bool Send(string title, string message)
	{
		// to send mail 
	}
}

public void main()
{
	MySmtpSender mySmtpSender = new MySmtpSender();
	TraceLog.ErrMsgSender = mySmtpSender;
}

Sample

// set the log file path and file Name
TraceLog.SetLogFile("D:\AppData\Log"), "TestLogConsole");

TraceLog.InfoWrite("main", "Start Process");

TraceLog.DebugWrite("methodName", "This is debug log");

TraceLog.WarnWrite("className", "This is warn log");

TraceLog.ErrorWrite("canTypeAnything", "This is error log");

TraceLog.InfoWrite("main", "End Process");

Result

D:\AppData\Log\TestLogConsole.2018-06-11.log

17:22:45.670 [main      ][INFO ] Start Process
17:22:45.671 [methodName][DEBUG] This is debug log
17:22:45.671 [className ][WARN ] This is warn log
17:22:45.671 [canTypeAnything][ERROR] This is error log
17:22:45.671 [main      ][INFO ] End Process

You can send error message when ErrorWrite

public interface IMsgSender
{
	bool Send(string title, string message);
}

public class MySmtpSender : IMsgSender
{
	public bool Send(string title, string message)
	{
		// to send mail 
	}
}

public void main()
{
	MySmtpSender mySmtpSender = new MySmtpSender();
	TraceLog.ErrMsgSender = mySmtpSender;
}

Dependencies

This package has no dependencies.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version History

Version Downloads Last updated
1.0.0 393 6/12/2018