![]() |
VOOZH | about |
dotnet add package ConsoleDebugger --version 1.0.8
NuGet\Install-Package ConsoleDebugger -Version 1.0.8
<PackageReference Include="ConsoleDebugger" Version="1.0.8" />
<PackageVersion Include="ConsoleDebugger" Version="1.0.8" />Directory.Packages.props
<PackageReference Include="ConsoleDebugger" />Project file
paket add ConsoleDebugger --version 1.0.8
#r "nuget: ConsoleDebugger, 1.0.8"
#:package ConsoleDebugger@1.0.8
#addin nuget:?package=ConsoleDebugger&version=1.0.8Install as a Cake Addin
#tool nuget:?package=ConsoleDebugger&version=1.0.8Install as a Cake Tool
ConsoleDebugger is a lightweight utility for console applications, providing robust logging and debug message management. It is ideal for applications with multiple asynchronous methods, background processes, or network operations. As of v1.0.8, advanced features such as audible beeps and float tracking are now available as separate extension packages, reducing the core package size and dependencies for users who only need basic logging.
To use ConsoleDebugger in your C# console application:
dotnet add package ConsoleDebugger --version 1.0.8
using ConsoleDebugger.ConsoleDebugger;
Or, for a more functional approach:
using static ConsoleDebugger.ConsoleDebugger;
Audible Beeps:
Install ConsoleDebugger.Beeps for beep/tone support:
dotnet add package ConsoleDebugger.Beeps --version 1.0.8
using ConsoleDebugger.Beeps;
Float Tracking:
Install ConsoleDebugger.FloatTracker for auditory float tracking:
dotnet add package ConsoleDebugger.FloatTracker --version 1.0.8
using ConsoleDebugger.FloatTracker;
Log debug messages with different colors and message types:
Result result = SomeNetworkFunction(); // example function
ConsoleDebugger.DebugMessage("We started the network function.");
if(result == Good){
ConsoleDebugger.DebugMessage($"Here's the result {result.ToString()}", ConsoleColor.Blue);
} else {
ConsoleDebugger.DebugMessage($"Critical error occurred: {result.Message}", MessageType.Critical);
}
You can define and control logging categories:
var netCategory = new LoggingCategory("Network");
ConsoleDebugger.AddLoggingCategory(netCategory);
ConsoleDebugger.DebugMessage("Network started", netCategory);
You can also control which logging categories are shown in the console output. By default, all categories are considered enabled. Use ActivateLoggingCategory(category) to enable console output for a category, or DeactivateLoggingCategory(category) to suppress it so the category no longer outputs to the console.
Note: Logging categories are always included in the file log if file logging is enabled, regardless of their console output status.
You can log messages to a file in either .txt or .csv format. By default, logs include the message, but you can configure additional options such as including timestamps, logging categories, and message types. The output format and included fields are controlled via the LoggingConfiguration class.
Enable or disable file logging:
ConsoleDebugger.StartLogging();
// ... your code ...
ConsoleDebugger.StopLogging();
Configure logging style and options via the LoggingConfiguration class, for example:
var config = new LoggingConfiguration {
IncludeTimestamp = true,
IncludeCategory = true,
IncludeMessageType = true,
LogFormat = LogFormat.Csv // or LogFormat.Txt
};
ConsoleDebugger.SetLoggingConfiguration(config);
To use beeps, ensure you have installed the ConsoleDebugger.Beeps package and initialized beeps:
ConsoleDebugger.InitializeBeeps();
ConsoleDebugger.DebugBeep(TonePitch.Do, ToneLength.Short);
ConsoleDebugger.DebugBeep(TonePitch.Re, ToneLength.Short);
To use float tracking, ensure you have installed the ConsoleDebugger.FloatTracker package and initialized float tracking:
ConsoleDebugger.InitializeFloatTracking();
float valueToTrack = 0.0f;
var synthesizer = ConsoleDebugger.StartTrackingFloat(ref valueToTrack, 0.0f, 100.0f);
As valueToTrack changes, an auditory tone will represent its value within the specified range.
DebugMessage(string message, LoggingCategory category = default)DebugMessage(string message, ConsoleColor color, LoggingCategory category = default)DebugMessage(string message, MessageType type, LoggingCategory category = default)StartLogging(), StopLogging()AddLoggingCategory, RemoveLoggingCategory, ActivateLoggingCategory, DeactivateLoggingCategory, LoggingCategoryActiveDebugBeep(TonePitch pitch, ToneLength duration)InitializeBeeps()StartTrackingFloat(ref float target, float minrange, float maxrange) : FloatSynthesizerInitializeFloatTracking()This project is licensed under the MIT License. See the file for details.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 net8.0 is compatible. net8.0-android net8.0-android was computed. net8.0-browser net8.0-browser was computed. net8.0-ios net8.0-ios was computed. net8.0-maccatalyst net8.0-maccatalyst was computed. net8.0-macos net8.0-macos was computed. net8.0-tvos net8.0-tvos was computed. net8.0-windows net8.0-windows was computed. net9.0 net9.0 was computed. net9.0-android net9.0-android was computed. net9.0-browser net9.0-browser was computed. net9.0-ios net9.0-ios was computed. net9.0-maccatalyst net9.0-maccatalyst was computed. net9.0-macos net9.0-macos was computed. net9.0-tvos net9.0-tvos was computed. net9.0-windows net9.0-windows was computed. net10.0 net10.0 was computed. net10.0-android net10.0-android was computed. net10.0-browser net10.0-browser was computed. net10.0-ios net10.0-ios was computed. net10.0-maccatalyst net10.0-maccatalyst was computed. net10.0-macos net10.0-macos was computed. net10.0-tvos net10.0-tvos was computed. net10.0-windows net10.0-windows was computed. |
Showing the top 3 NuGet packages that depend on ConsoleDebugger:
| Package | Downloads |
|---|---|
|
P2PNet
P2PNet is a peer-to-peer facilitation library with the goal of seamless peer discovery, secure encryption, and distributed data exchange. |
|
|
ConsoleDebugger.Beeps
Extension of ConsoleDebugger. Introduces simply formatted beep messages using Do, Re, Mi, Sol, ect. with different pre-defined tone lengths. |
|
|
ConsoleDebugger.FloatTracker
Extension of ConsoleDebugger. Introduces auditory float tracking. Pass any float variable in your application, and a min/max range to hear an auditory tone representing the value in range as a percentage. Can be useful for developing where I/O is dealing with large quantities of information or preforming several rapid operations - good for mental visualization. |
This package is not used by any popular GitHub repositories.
Beep and float tracking functionality have been put in separate packages. This will reduce the minimum reuquired package size for simple application needs, so audio library is not pulled in by defaultlt for apps that dont't needd or want it. Apps will not be required to enable unsafe code either, unless they want optional auditory float tracking.