SKitLs.Utils.Loggers
1.4.0
Prefix Reserved
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
<PackageReference Include="SKitLs.Utils.Loggers" Version="1.4.0" />
paket add SKitLs.Utils.Loggers --version 1.4.0
#r "nuget: SKitLs.Utils.Loggers, 1.4.0"
// 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
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:
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.
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.
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
Using Terminal Command:
To install the project using the terminal command, follow these steps:
- Open the terminal or command prompt.
- Run command:
dotnet add package SKitLs.Utils.Loggers
Using NuGet Packages Manager:
To install the project using the NuGet Packages Manager, perform the following steps:
- Open your preferred Integrated Development Environment (IDE) that supports NuGet package management (e.g., Visual Studio).
- Create a new project or open an existing one.
- Select "Project" > "Manage NuGet Packages"
- In the "Browse" tab, search for the project package you want to install.
- Click on the "Install" button to add the selected package to your project.
- Follow any additional setup instructions or configurations provided in the project's documentation.
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:
- Visit the project repository on GitHub
- Click on the "Code" button and select "Download ZIP" to download the project's source code as a zip archive.
- Extract the downloaded zip archive to the desired location on your local machine.
- Open your existing project or create a new one in your IDE.
- Add the downloaded project files to your solution using the "Add Existing Project" option in your IDE's solution explorer.
- Reference the project in your solution and ensure any required dependencies are resolved.
- 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:
Initialize the DefaultConsoleLogger:
ILogger logger = new DefaultConsoleLogger();
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:
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. }
Initialize Your Custom Logger:
ILogger logger = new CustomLogger(); // Use your custom logger to handle logging in your project.
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 | Versions 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. |
-
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.
XML Docimentation Included