Available

amalgame-logging

4 levels, ISO 8601 UTC, optional file sink.

amc package add logging GitHub ↗ ← Back to the ecosystem

Overview

Minimal logger. Debug / Info / Warn / Error levels. Writes to stderr, optional file sink. ISO 8601 UTC timestamps, to the second. No magic: one call = one line. Built for CLIs and single-threaded servers; an internal lock is planned for v2.

Features

  • ✓Levels: Debug, Info, Warn, Error
  • ✓Format: ISO 8601 UTC + level + message
  • ✓stderr output, optional file sink (append, no rotation)
  • ✓Minimum level set with Log.SetMinLevel("warn")
  • ✓Log.Raw(line) writes a line as is, JSON for example (v0.2)

Example

Minimal usage example — copy-paste runnable after install.

amc package add logging

import Amalgame.Logging

class Program {
    public static void Main() {
        Log.SetMinLevel("info")    // "debug" | "info" | "warn" | "error"
        Log.SetFile("app.log")     // optional: also append each line to a file

        Log.Debug("hidden at info level")
        Log.Info("server started on :8080")
        Log.Warn("config file missing, using defaults")
        Log.Error("db connection failed")
    }
}

At a glance

Related packages