Table of Contents

Enum DiagnosticLevel

Namespace
Egami
Assembly
Egami.dll

How much an EgamiDiagnostic matters. Maps one to one onto the Debug, Information and Warning log levels.

public enum DiagnosticLevel

Fields

Debug = 0

Detail for someone chasing a problem, such as a safety limit about to throw or the band count of a parallel decode.

Info = 1

A notable decision Egami made for the caller, such as the format detected or the factor picked for a scaled decode.

Warning = 2

A problem Egami recovered from, or something lost on purpose, such as a bad checksum read leniently or alpha dropped when saving JPEG. Every Warning raised by a load is also in Warnings.

Examples

// Info and Debug events are off unless asked for; below the level they are never even formatted.
EgamiContext verbose = EgamiContext.Default with
{
    Diagnostics = d => seen.Add(d),
    DiagnosticLevel = DiagnosticLevel.Debug,
};

using Raster image = Raster.Load("duck.jpg", verbose, new ReaderOptions { MinimumSize = new Size(100, 100) });
foreach (EgamiDiagnostic d in seen)
{
    Console.WriteLine($"{d.Level,-7} {d.Id}: {d.Message}");
}