Chickensoft.GoDotLog 1.0.2-beta1

.NET 6.0
This is a prerelease version of Chickensoft.GoDotLog.
There is a newer prerelease version of this package available.
See the version list below for details.
dotnet add package Chickensoft.GoDotLog --version 1.0.2-beta1
NuGet\Install-Package Chickensoft.GoDotLog -Version 1.0.2-beta1
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="Chickensoft.GoDotLog" Version="1.0.2-beta1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Chickensoft.GoDotLog --version 1.0.2-beta1
#r "nuget: Chickensoft.GoDotLog, 1.0.2-beta1"
#r directive can be used in F# Interactive, C# scripting and .NET Interactive. Copy this into the interactive tool or source code of the script to reference the package.
// Install Chickensoft.GoDotLog as a Cake Addin
#addin nuget:?package=Chickensoft.GoDotLog&version=1.0.2-beta1&prerelease

// Install Chickensoft.GoDotLog as a Cake Tool
#tool nuget:?package=Chickensoft.GoDotLog&version=1.0.2-beta1&prerelease

GoDotLog

Chickensoft Badge Discord line coverage branch coverage

Opinionated Godot logging interface and console implementation.

public class MyEntity {
  // Create a log which outputs messages prefixed with the name of the class.
  private ILog _log = new GDLog(nameof(MyClass));
}

Logs can perform a variety of common actions (and output messages if they fail automatically):

_log.Print("My message");

_log.Warn("My message");

_log.Err("My message");

// Run a potentially unsafe action. Any errors thrown from the action will
// be output by the log. An optional error handler callback can be provided
// which will be invoked before the exception is rethrown.
_log.Run(
  () => { _log.Print("Potentially unsafe action"); },
  (e) => {
    _log.Err("Better clean up after myself...whatever I did failed.");
  }
);

// Throw an assertion exception with the given message if the assertion fails.
_log.Assert(node.Name == "MyNode", "Must be valid node name.");

// Return the value of a function or a fallback value.
var result = _log.Always<T>(
  () => new Random().Next(0, 10) > 5 ? "valid value" : null,
  "fallback value"
);

// Print a decently formatted stack trace.
_log.Print(new StackTrace());
Product Versions
.NET net6.0 net6.0-android net6.0-ios net6.0-maccatalyst net6.0-macos net6.0-tvos net6.0-windows net7.0 net7.0-android net7.0-ios net7.0-maccatalyst net7.0-macos net7.0-tvos net7.0-windows
Compatible target framework(s)
Additional computed target framework(s)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on Chickensoft.GoDotLog:

Package Downloads
Chickensoft.GoDotNet

State machines, notifiers, and other utilities for C# Godot development.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.0.2-beta6 36 11/24/2022
1.0.2-beta3 40 10/29/2022
1.0.2-beta1 60 9/17/2022
1.0.1-beta1 50 9/17/2022
1.0.0-beta1 49 9/17/2022
0.0.5 544 6/20/2022
0.0.4 500 6/18/2022
0.0.3 165 6/18/2022
0.0.2 166 6/18/2022
0.0.1 165 6/18/2022

Initial release.