Luilliarcec.Logger
1.0.3
See the version list below for details.
dotnet add package Luilliarcec.Logger --version 1.0.3
NuGet\Install-Package Luilliarcec.Logger -Version 1.0.3
<PackageReference Include="Luilliarcec.Logger" Version="1.0.3" />
paket add Luilliarcec.Logger --version 1.0.3
#r "nuget: Luilliarcec.Logger, 1.0.3"
// Install Luilliarcec.Logger as a Cake Addin #addin nuget:?package=Luilliarcec.Logger&version=1.0.3 // Install Luilliarcec.Logger as a Cake Tool #tool nuget:?package=Luilliarcec.Logger&version=1.0.3
Net Framework Logger
Helps keep a record of exceptions generated at runtime.
Installation
You can install the package via nuget:
dotnet add package Luilliarcec.Logger
Usage
You can use the Logger in each method that is necessary
using Luilliarcec.Logger;
// ...
namespace Test
{
public class Foo
{
public void Sumar()
{
try {
// ...
} catch (Exception ex) {
Log.Error(ex);
}
}
}
}
Or you can use the Application.ThreadException event to catch all the unhandled errors.
using Luilliarcec.Logger;
// ...
namespace YourProject
{
static class Program
{
/// <summary>
/// Punto de entrada principal para la aplicación.
/// </summary>
[STAThread]
static void Main()
{
// ...
Application.ThreadException += Application_ThreadException;
// ...
}
private static void Application_ThreadException(object sender, System.Threading.ThreadExceptionEventArgs e)
{
Log.Error(e.Exception);
}
}
}
The exposed methods to keep an error log are:
Methods | Return | Description |
---|---|---|
Error | bool |
Save the file with error type |
Warning | bool |
Save the file with warning type |
Info | bool |
Save the file with information type |
Drop | bool |
Delete the file |
Copy | bool |
Copy the file to a destination path |
Exists | bool |
Verify that the file exists in the directory |
Path | property (get, set) |
Log path, default project root directory |
Follow these tips and have a happy code.
Security
If you discover any security related issues, please email luilliarcec@gmail.com instead of using the issue tracker.
Credits
License
The MIT License (MIT). Please see License File for more information.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET Framework | net45 is compatible. net451 was computed. net452 was computed. net46 was computed. net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
This package has no dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Logger exceptions.