AnointedAutomation.Logging 1.0.8

There is a newer version of this package available.
See the version list below for details.
dotnet add package AnointedAutomation.Logging --version 1.0.8
                    
NuGet\Install-Package AnointedAutomation.Logging -Version 1.0.8
                    
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="AnointedAutomation.Logging" Version="1.0.8" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="AnointedAutomation.Logging" Version="1.0.8" />
                    
Directory.Packages.props
<PackageReference Include="AnointedAutomation.Logging" />
                    
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 AnointedAutomation.Logging --version 1.0.8
                    
#r "nuget: AnointedAutomation.Logging, 1.0.8"
                    
#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 AnointedAutomation.Logging@1.0.8
                    
#: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=AnointedAutomation.Logging&version=1.0.8
                    
Install as a Cake Addin
#tool nuget:?package=AnointedAutomation.Logging&version=1.0.8
                    
Install as a Cake Tool

AnointedAutomation.Logging

Jesus is King ✝️

A small log message model with no dependencies for .NET. LogMessage captures the message, severity, timestamp, program name and calling method, and raises a static event every time one is created so you can route logs wherever you like.

NuGet Downloads

Installation

dotnet add package AnointedAutomation.Logging
  • Target framework: net10.0
  • Dependencies: none

Quick start

using System;
using AnointedAutomation.Optimization.Logging;

// Name your program once at startup; every LogMessage copies it into messageSource.
LogMessage.MessageSourceSetter = "MyApplication";

// Subscribe once; the event fires from every LogMessage constructor.
LogMessage.LogAdded += (sender, e) =>
{
    Console.WriteLine($"{e.log.timeStamp:O} [{e.log.messageType}] {e.log.localOperationName}: {e.log.message}");
};

LogMessage.Info("Application started.");
LogMessage.Warning(42, "Cache miss rate is high.");
LogMessage.Error("Could not reach the payment provider.");

try { /* ... */ }
catch (Exception ex)
{
    LogMessage.Error("Order 1001 capture failed", ex); // keeps the type, inner exceptions and stack
}

Note the namespace: the types live in AnointedAutomation.Optimization.Logging, not AnointedAutomation.Logging.

API overview

All types are in the AnointedAutomation.Optimization.Logging namespace.

LogMessage

Member Description
LogMessage() Empty instance for object initializers. Raises no event and stamps nothing: a message built this way never reaches a LogAdded subscriber (your log store or alerts).
LogMessage(MessageType messageType, string message) Sets timeStamp (DateTime.UtcNow), messageSource, localOperationName (stack walk) and raises LogAdded.
LogMessage(long id, MessageType messageType, string message) Same as above, with an id.
static string MessageSourceSetter Program name copied into every new message's messageSource.
static event LogAddedEventHandler LogAdded Raised whenever a message is constructed with a type and text. Each subscriber runs in isolation: one that throws is reported on Console.Error and never breaks the caller.
long id Optional identifier.
string localOperationName Factories: the exact call site as File.Member:line (compiler caller info, no stack walk). Typed constructors: the calling method from the stack (Namespace.Class.Method).
string message The log text.
string messageSource Program name (from MessageSourceSetter).
MessageType messageType Severity.
DateTime timeStamp UTC creation time.
string exceptionType Full type name of the exception passed to an exception overload.
string callerMemberName / callerFilePath / int callerLineNumber Call site recorded by the factories.
string category / storeSlug / properties Optional context for bridges and multi-tenant apps (category, tenant, JSON properties).

Static factory methods, each with a (string message) and a (long id, string message) overload. Critical, Error and Warning also take (string message, Exception exception), which appends the full exception (type, inner exceptions, stack with file:line) to the message:

Factory Produces
LogMessage.Celebrate MessageType.Celebrate
LogMessage.Critical MessageType.Critical
LogMessage.Error MessageType.Error
LogMessage.Info / LogMessage.Informational MessageType.Informational
LogMessage.Message MessageType.Message
LogMessage.Success MessageType.Success
LogMessage.Warning MessageType.Warning

LogMessageEventArgs

EventArgs passed to LogAdded; the message is exposed as the log property. The delegate is LogMessage.LogAddedEventHandler(object sender, LogMessageEventArgs e).

MessageType

enum MessageType : int

Value Number Meaning
Error 0 An error that should be investigated
Warning 1 A potential issue
Success 2 A successful operation
Informational 3 General information
Message 4 A general message with no severity
Critical 5 A severe error needing immediate attention
Celebrate 6 A milestone or achievement

Notes

  • LogAdded is a static event. Every LogMessage created anywhere in the process reaches every subscriber, so subscribe once and unsubscribe when your listener goes away.
  • The factories record the caller with [CallerMemberName]/[CallerFilePath]/[CallerLineNumber] at no runtime cost; only the typed constructors capture a StackTrace.
  • Since 1.0.7 the package ships an embedded portable PDB, so stack traces through it show file and line.

Other AnointedAutomation packages build on this one and expose their own log buffers of LogMessage:

License

MIT. See LICENSE.

Support This Project

This library is free and open source. The best way to support the work is to shop with us:

Found a bug or have a request? Open an issue at https://github.com/AnointedAutomation/AnointedAutomation/issues.

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  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.
  • net10.0

    • No dependencies.

NuGet packages (7)

Showing the top 5 NuGet packages that depend on AnointedAutomation.Logging:

Package Downloads
AnointedAutomation.Repository.Mongo

A MongoDB helper and generic repository base for .NET, with CRUD, paging, aggregation, index management, BSON class maps and casing conventions.

AnointedAutomation.APIMiddlewares

ASP.NET Core middleware and filters for API key authentication, IP blacklisting, country blocking, honeypot and bot defense, invalid endpoint tracking and idle time memory cleanup.

AnointedAutomation.Memory

On demand garbage collection helper that forces a full collection and tries to return unused memory to the operating system.

AnointedAutomation.Serialization

Shared serialization helpers: naming rules (camel, Pascal, snake and the hybrid value/reference casing rule), System.Text.Json casing convention, presets and UTC DateTime converter, tolerant Newtonsoft.Json converters, and lenient JsonElement readers. No MongoDB dependency.

AnointedAutomation.Concepts

Models Biblical concepts as .NET types: love as a behavior tree, a moral reality that reads acts against God's character, and an epistemics engine that checks claims for consistency.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.1.1 0 11/18/2026
1.1.0 1,190 11/13/2026
1.0.8 3,479 11/4/2026
1.0.6 746 10/26/2026
1.0.5 601 10/1/2026
1.0.4 169 10/1/2026
1.0.3 297 9/25/2026
1.0.2 655 8/23/2026
1.0.1 1,287 5/30/2026
1.0.0 1,040 3/15/2026
0.0.10 327 3/13/2026
0.0.9 217 3/11/2026
0.0.8 788 2/17/2026