SKitLs.Utils.Loggers 1.4.0

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

// Install SKitLs.Utils.Loggers as a Cake Tool
#tool nuget:?package=SKitLs.Utils.Loggers&version=1.4.0                

SKitLs.Utils.Loggers GitHub Nuget CodeFactor GitHub code size in bytes

This project aims to streamline the logging process and simplify debugging for developers.

Description

Main purpose of the project is achieved through a well-designed lightweight architecture consisting of three key elements:

  1. enum LogType:

    The LogType enum serves as a central component for categorizing different types of log messages within the project . By using this enumeration, developers can easily identify and manage logs based on their specific purposes and significance.

    This enhances the overall organization of log data, making it more manageable and accessible.

  2. interface ILogger:

    The ILogger interface provides a standardized mechanism for logging messages throughout the project. It abstracts the logging functionality and defines a set of methods and properties that any logging implementation must support.

    This decoupling of logging logic allows developers to switch between different logging implementations without affecting the core functionality of the application.

  3. class DefaultConsoleLogger : ILogger:

    The DefaultConsoleLogger class is a concrete implementation of the ILogger interface, specifically tailored for Console Projects. It offers a default logging behavior for outputting events and messages to the console. By leveraging this implementation, developers can quickly enable logging in their Console-based applications without the need for extensive configuration.

By combining these three elements, developers can create a versatile and extendable logging framework that facilitates debugging and improves overall project maintainability.

The LogType enum categorizes logs, the ILogger interface provides a standardized logging mechanism, and the DefaultConsoleLogger class offers a default logging solution for Console Projects.

This architecture promotes code reusability, modularity, and ease of use, empowering developers to efficiently manage log data and identify and resolve issues during the development process.

Setup

Requirements

This project does not have any external dependencies. It is a self-contained solution that does not require the installation of additional libraries or components.

Installation

  1. Using Terminal Command:

    To install the project using the terminal command, follow these steps:

    1. Open the terminal or command prompt.
    2. Run command:
    dotnet add package SKitLs.Utils.Loggers
    
  2. Using NuGet Packages Manager:

    To install the project using the NuGet Packages Manager, perform the following steps:

    1. Open your preferred Integrated Development Environment (IDE) that supports NuGet package management (e.g., Visual Studio).
    2. Create a new project or open an existing one.
    3. Select "Project" > "Manage NuGet Packages"
    4. In the "Browse" tab, search for the project package you want to install.
    5. Click on the "Install" button to add the selected package to your project.
    6. Follow any additional setup instructions or configurations provided in the project's documentation.
  3. Downloading Source Code and Direct Linking:

    To install the project by downloading the source code and directly linking it to your project, adhere to the following steps:

    1. Visit the project repository on GitHub
    2. Click on the "Code" button and select "Download ZIP" to download the project's source code as a zip archive.
    3. Extract the downloaded zip archive to the desired location on your local machine.
    4. Open your existing project or create a new one in your IDE.
    5. Add the downloaded project files to your solution using the "Add Existing Project" option in your IDE's solution explorer.
    6. Reference the project in your solution and ensure any required dependencies are resolved.
    7. Follow any additional setup or configuration instructions provided in the project's documentation.

Please note that each method may have specific requirements or configurations that need to be followed for successful installation. Refer to the project's documentation for any additional steps or considerations.

Usage

Enhancing Console-Based Logging:

For Console-based projects, you can take advantage of the DefaultConsoleLogger class:

  1. Initialize the DefaultConsoleLogger:

    ILogger logger = new DefaultConsoleLogger();
    
  2. Logging Messages to the Console:

    logger.Log("This is an informational message.", LogType.Info);
    logger.Log("Warning: Potential issue detected!", LogType.Warning);
    logger.Log($"Error occurred: {exception.Message}", LogType.Error);
    // or
    logger.Warn("Warning: Potential issue detected!");
    logger.Error($"Error occurred: {exception.Message}");
    

Customizing Logging Behavior:

If you need to customize the logging behavior based on your project's specific requirements, implement the ILogger interface in a custom class:

  1. Create a Custom Logger Class:

    public class CustomLogger : ILogger
    {
        // Implement the methods from the ILogger interface as per your custom logging needs.
        // Example: You can log messages to a file, database, or an external service.
    }
    
  2. Initialize Your Custom Logger:

    ILogger logger = new CustomLogger(); // Use your custom logger to handle logging in your project.
    
  3. Log Your Messages:

    logger.Log("This is an informational message.", LogType.Info);
    logger.Warn("Warning: Potential issue detected!");
    logger.Error($"Error occurred: {exception.Message}");
    

Contributors

Currently, there are no contributors actively involved in this project. However, our team is eager to welcome contributions from anyone interested in advancing the project's development.

We value every contribution and look forward to collaborating with individuals who share our vision and passion for this endeavor. Your participation will be greatly appreciated in moving the project forward.

Thank you for considering contributing to our project.

License

This project is distributed under the terms of the MIT License.

Copyright (C) Sargeras02 2023

Developer contact

For any issues related to the project, please feel free to reach out to us through the project's GitHub page. We welcome bug reports, feedback, and any other inquiries that can help us improve the project.

You can also contact the project owner directly via their GitHub profile at the following link.

Your collaboration and support are highly appreciated, and we will do our best to address any concerns or questions promptly and professionally. Thank you for your interest in our project.

Notes

This project is utilized by a larger and well-established project, which can be found at the following link.

Thank you for choosing our solution for your needs, and we look forward to contributing to your project's success.

Product Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net6.0

    • No dependencies.

NuGet packages (2)

Showing the top 2 NuGet packages that depend on SKitLs.Utils.Loggers:

Package Downloads
SKitLs.Bots.Telegram.Core

The core module of the SKitLs.Bots.Telegram Framework.

SKitLs.Utils.LocalLoggers

Offers an advanced logging system that streamlines the logging process and simplifies debugging by using localized debug messages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
2.0.4 108 9/26/2024
2.0.3 89 9/26/2024
2.0.2 107 9/11/2024
2.0.1 123 9/10/2024
2.0.0 99 9/10/2024
2.0.0-preview.1 75 8/20/2024
2.0.0-preview.0 58 8/20/2024
1.4.1 1,422 8/11/2023
1.4.0 491 7/31/2023
1.3.0 160 7/27/2023
1.2.1 262 7/26/2023

XML Docimentation Included