pryLogger 0.2.15

dotnet add package pryLogger --version 0.2.15
                    
NuGet\Install-Package pryLogger -Version 0.2.15
                    
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="pryLogger" Version="0.2.15" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="pryLogger" Version="0.2.15" />
                    
Directory.Packages.props
<PackageReference Include="pryLogger" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add pryLogger --version 0.2.15
                    
#r "nuget: pryLogger, 0.2.15"
                    
#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.
#addin nuget:?package=pryLogger&version=0.2.15
                    
Install pryLogger as a Cake Addin
#tool nuget:?package=pryLogger&version=0.2.15
                    
Install pryLogger as a Cake Tool

pryLogger

This sample project demonstrates the usage of the pryLogger library for event logging and error handling in a C# application. The application makes REST API calls and configures email notifications in case of errors.

Requirements

  • Connection Database: Ensure you have an database set up with a valid connection string, in this case is with Oracle

Usage Example

using Oracle.ManagedDataAccess.Client;

using pryLogger.src.Rest;
using pryLogger.src.Rest.Xml;
using pryLogger.src.Log.Attributes;
using pryLogger.src.Log.Strategies;

using pryLogger.src.ErrorNotifier.MailNotifier;

public class Program
{
    public static void onException(Exception ex)
    {
        Console.WriteLine($"catchException : {ex.Message}");
    }

    [ConsoleLog]
    static void level1([LogRename("customParam")] string test = "lala land")
    {
        level2();
        //var dt = ConnectionManager.Instance.GetConnection<OracleConnection>().SelectQuery("select query. ...");
        throw new Exception();
    }

    [ConsoleLog(nameof(onException))]
    static void level2()
    {
        string url = "url";
        var body = new { };
        var res = RestClient.Fetch<object>(new RestRequest(url)
        {
            Method = "POST",
            Content = Soap.CreateXmlRequest("urlRequest", null, body, Declarations.UTF8),
            ContentType = "text/xml; charset=UTF-8",
        }, rest =>
        {
            object result = Soap.FromXmlResponse("response", rest.Content);
            return result;
        });
    }

    static void Main(string[] args)
    {
        string connectionString = "database connection string";
        string mailConnectionString = "host=mailhost; port=1234; from=cari@test.com; to=anothermail; repo=gitrepository.git";

        ConsoleLog.MailErrorNotifier.SetConnectionString(mailConnectionString);
        //ConnectionManager.Instance.SetConnectionString<OracleConnectionStringBuilder>(connectionString);

        level1();
        Console.ReadKey();
    }
}
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.

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
0.2.15 146 12/29/2023
0.2.13 200 11/10/2023
0.2.9 121 11/9/2023
0.2.7 117 11/9/2023
0.2.6 140 11/8/2023
0.2.5 118 11/8/2023
0.2.2 134 9/14/2023
0.1.1 107 4/10/2024

- Added logging functionality to files, lite.db file and the console.
     - Implemented event management for REST APIs and databases.
     - Introduced database connection management.
     - Included extensions for XML handling within a REST API.