Luilliarcec.Logger 1.0.3

There is a newer version of this package available.
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                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Luilliarcec.Logger" Version="1.0.3" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Luilliarcec.Logger --version 1.0.3                
#r "nuget: Luilliarcec.Logger, 1.0.3"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// 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

latest version downloads

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 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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.

Version Downloads Last updated
1.1.0 607 4/10/2020
1.0.3 483 4/7/2020
1.0.2 497 4/7/2020
1.0.1 487 4/7/2020

Logger exceptions.