Log78 1.0.4

There is a newer version of this package available.
See the version list below for details.
dotnet add package Log78 --version 1.0.4
                    
NuGet\Install-Package Log78 -Version 1.0.4
                    
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="Log78" Version="1.0.4" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Log78" Version="1.0.4" />
                    
Directory.Packages.props
<PackageReference Include="Log78" />
                    
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 Log78 --version 1.0.4
                    
#r "nuget: Log78, 1.0.4"
                    
#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.
#:package Log78@1.0.4
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Log78&version=1.0.4
                    
Install as a Cake Addin
#tool nuget:?package=Log78&version=1.0.4
                    
Install as a Cake Tool

<h1 align="center">Log78</h1> <div align="center">

English | 简体中文

License Test Status QQ Group </div>

Feedback QQ Group (Click to join): 323397913

1. Log78 Class Documentation

Overview

Log78 is a class for encapsulating logging functionality, supporting various types of log output including console output, file output, and server-side output. This class uses the singleton pattern to ensure there is only one instance globally and provides methods for setting different log levels.

Installation

Install via NuGet Package Manager:

dotnet add package Log78

Usage

using www778878net.log;

var log = Log78.Instance;
log.setup(serverLogger, fileLogger, consoleLogger, "admin");
log.log("Hello, world!", 50);

Properties

  • debugKind: A list of log debugging kinds used to control which types of logs are recorded.
  • LevelFile, LevelConsole, LevelApi: Respectively represent the threshold levels for file logs, console logs, and API logs. By default, the console log level is 30, the file log level is 50, and the API log level is 70.
  • serverLogger, fileLogger, consoleLogger: Respectively represent the server logger, file logger, and console logger instances.
  • uname: The username, which defaults to an empty string.

Methods

  • setup: Sets up the logger instances.
  • Clone: Creates a clone of the current instance.
  • LogErr: Logs error messages.
  • Log: Logs messages based on the provided parameters. Log levels can be set individually for each class.

Example

using www778878net.log;

// Create logger instances
var serverLogger = new ServerLog78();
var fileLogger = new FileLog78("logfile");
var consoleLogger = new ConsoleLog78();

// Get the Log78 instance
var log = Log78.Instance;

// Setup the logger
log.setup(serverLogger, fileLogger, consoleLogger, "admin");

// Log a message
log.Log("This is a log message.", 50); // Both console and file will output because 50 >= 30 && 50 >= 50

// Log an error message
try
{
    throw new Exception("Something went wrong!");
}
catch (Exception error)
{
    log.LogErr(error);
}

Other

For more detailed information, please refer to the project's GitHub repository or the API documentation.

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.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net6.0

NuGet packages (1)

Showing the top 1 NuGet packages that depend on Log78:

Package Downloads
HttpClient78

Package Description

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
2.2.5 127 9/12/2024
2.1.2 119 9/6/2024
2.0.37 120 9/6/2024
2.0.36 122 9/5/2024
2.0.35 118 9/5/2024
2.0.34 113 9/5/2024
2.0.33 119 9/5/2024
2.0.32 117 9/5/2024
2.0.29 124 9/5/2024
2.0.5 123 9/4/2024
2.0.4 119 9/4/2024
2.0.2 121 9/4/2024
1.0.10 107 8/31/2024
1.0.9 107 8/30/2024
1.0.8 108 8/30/2024
1.0.7 106 8/30/2024
1.0.6 108 8/30/2024
1.0.5 119 8/28/2024
1.0.4 110 8/27/2024
1.0.3 109 8/27/2024
1.0.2 106 8/27/2024
0.0.8323.12 454 10/15/2022
0.0.8321.54 963 10/13/2022
0.0.8321.8 434 10/13/2022
0.0.8321.6 437 10/13/2022
0.0.8321.5 428 10/13/2022