AnayaRojoTools 2.0.0

dotnet add package AnayaRojoTools --version 2.0.0
NuGet\Install-Package AnayaRojoTools -Version 2.0.0
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="AnayaRojoTools" Version="2.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add AnayaRojoTools --version 2.0.0
#r "nuget: AnayaRojoTools, 2.0.0"
#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 AnayaRojoTools as a Cake Addin
#addin nuget:?package=AnayaRojoTools&version=2.0.0

// Install AnayaRojoTools as a Cake Tool
#tool nuget:?package=AnayaRojoTools&version=2.0.0

Anaya Rojo Tools

Nuget installation:
Install-Package AnayaRojoTools -Version 2.0.0
Configuración de ejemplo para el uso básico de la configuración:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
  <connectionStrings>
    <add name="Connection" connectionString=""/>
  </connectionStrings>
  <appSettings>
    <add key="string" value="string"></add>
    <add key="char" value="c"></add>
    <add key="int" value="1"></add>
    <add key="long" value="123456789"></add>
    <add key="float" value="1.5"></add>
    <add key="double" value="1.5"></add>
    <add key="decimal" value="1.5"></add>
    <add key="date" value="13/12/2017"></add>
    <add key="bool" value="True"></add>
    <add key="enum" value="ENUM_A"></add>
  </appSettings>
</configuration>
Uso básico de la configuración:
using System;
using AnayaRojo.Tools.Configs;

public class Program
{
  public static void Main()
  {
    string lStrValue = Config.GetValue<string>("string");
    char lChrValue = Config.GetValue<char>("char");
    int lIntValue = Config.GetValue<int>("int");
    long lLonValue = Config.GetValue<long>("long");
    float lFltValue = Config.GetValue<float>("float");
    double lFltValue = Config.GetValue<double>("double");
    decimal lDmlValue = Config.GetValue<decimal>("decimal");
    DateTime lDtmValue = Config.GetValue<DateTime>("date");
    bool lBolValue = Config.GetValue<bool>("bool");
    SampleEnum lEnmValue = Config.GetValue<SampleEnum>("enum");
  }
}

public enum SampleEnum
{
    ENUM_A,
    ENUM_B,
    ENUM_C
}
Configuración del log:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
    <configSections>
      <section name="logsConfiguration" type="AnayaRojo.Tools.Configs.Sections.LogsSection, AnayaRojo.Tools" />
    </configSections>
    <logsConfiguration>
      <visibility
        showInfo="true"
        showSuccess="true"
        showTracking="true"
        showProcess="true"
        showWarning="true"
        showError="true"
        showException="true">
      </visibility>
      <log
        format="{date} [{type}] {message}"
        dateFormat="yyyy-MM-dd HH:mm:ss"
        active="true"
        webLog="false"
        fullLog="false"
        multiFiles="false"
        fileName="AppLog"
        relativePath="false"
        path="">
      </log>
  </logsConfiguration>
</configuration>
Uso básico del log:
using System;
using AnayaRojo.Tools.Logs;
using AnayaRojo.Tools.Logs.Enums;

public class Program
{
  public static void Main()
  {
    //Default log
    Log.Write("Log test");

    //Write by type
    Log.Write(LogTypeEnum.SUCCESS, "Success log");
    Log.Write(LogTypeEnum.INFO, "Info log");
    Log.Write(LogTypeEnum.PROCESS, "Process log");
    Log.Write(LogTypeEnum.TRACKING, "Tracking log");
    Log.Write(LogTypeEnum.WARNING, "Warning log");
    Log.Write(LogTypeEnum.ERROR, "Error log");
    Log.Write(LogTypeEnum.EXCEPTION, "Exception log");

    //Write with format
    Log.Write(LogTypeEnum.INFO, "Format of the log {0}", "AnayaRojo");

    //Write exception
    Log.Write(new Exception("Log exception"));
  }
}

See code on GitHub

Product Compatible and additional computed target framework versions.
.NET Framework net45 is compatible.  net451 is compatible.  net452 is compatible.  net46 is compatible.  net461 is compatible.  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
2.0.0 1,082 6/10/2018
1.0.0 958 5/2/2018

Configuration, Log and code extensions