Prowl.Echo routes all diagnostic output — serialization errors, deserialization warnings, condition evaluation failures, and readonly-field alerts — through a single static logger property. By default that property holds a no-op implementation so Echo is silent out of the box. Swapping in your own logger is a one-line change that gives you full visibility into Echo’s internals without any coupling to a specific logging library.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/ProwlEngine/Prowl.Echo/llms.txt
Use this file to discover all available pages before exploring further.
Serializer.Logger
Serializer.Logger is a static property on the Serializer class. Assign any IEchoLogger implementation to it before your first serialization call. All Echo internals call through this property, so a single assignment covers the entire library.
IEchoLogger Interface
The interface is intentionally minimal — four methods that map to the four standard severity levels:
Method Reference
Debug(string message)
Low-level diagnostic messages. Not currently emitted by the core library but available for your own
ISerializationFormat or ISerializable implementations to use via Serializer.Logger.Debug(...).Info(string message)
Informational messages about normal serialization events. Use this level for progress reporting in custom formats.
Warning(string message)
Non-fatal anomalies. Echo emits warnings when, for example, a
[SerializeIf] condition member cannot be found on the type, or when a readonly field is about to be set during deserialization.Error(string message, Exception? exception = null)
Failures that prevented a field from being serialized or deserialized. The
exception parameter is optional — some error paths provide it, others do not. Echo does not rethrow after logging; it skips the affected field and continues, so a single bad field does not abort the entire operation.When Echo Logs
Echo emits log messages in the following situations:| Severity | Situation |
|---|---|
Warning | A [SerializeIf] condition member was not found or doesn’t return bool |
Warning | A readonly field is being set during deserialization |
Error | A field failed to serialize (exception caught internally) |
Error | A field failed to deserialize (exception caught internally) |
Error | A type is abstract or an interface and cannot be instantiated |
Error | A type has no parameterless constructor |
Error | Activator.CreateInstance threw for any other reason |
Error | A [SerializeIf] condition evaluation threw an exception |
NullEchoLogger — The Default
NullEchoLogger is the built-in no-op implementation. All four methods are empty, which means Echo produces no output unless you replace the logger.
Implementing a Custom Logger
ImplementIEchoLogger and forward each method to your preferred logging sink. Here are three common patterns:
Console Logger
Microsoft.Extensions.Logging Bridge
Serilog Bridge
Assigning the Logger
Assign your logger once, early in your application’s startup sequence, before any serialization takes place:Using the Logger in Custom Formats
Your ownISerializationFormat and ISerializable implementations can emit through the same logger, keeping all Echo-related output in one place: