pryLogger 0.2.9

There is a newer version of this package available.
See the version list below for details.
dotnet add package pryLogger --version 0.2.9                
NuGet\Install-Package pryLogger -Version 0.2.9                
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.9" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add pryLogger --version 0.2.9                
#r "nuget: pryLogger, 0.2.9"                
#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 pryLogger as a Cake Addin
#addin nuget:?package=pryLogger&version=0.2.9

// Install pryLogger as a Cake Tool
#tool nuget:?package=pryLogger&version=0.2.9                

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 130 12/29/2023
0.2.13 184 11/10/2023
0.2.9 108 11/9/2023
0.2.7 106 11/9/2023
0.2.6 124 11/8/2023
0.2.5 107 11/8/2023
0.2.2 122 9/14/2023
0.1.1 92 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.