Disponible
amalgame-logging
4 niveaux, ISO 8601 UTC, file sink optionnel.
Vue d'ensemble
Logger minimaliste. Niveaux Debug / Info / Warn / Error. Sortie sur stderr, file sink optionnel. Horodatage ISO 8601 UTC, à la seconde. Pas de magie : un appel = une ligne. Prévu pour les CLI et les serveurs à un seul thread ; un verrou interne est prévu en v2.
Caractéristiques
- ✓Niveaux :
Debug,Info,Warn,Error - ✓Format : ISO 8601 UTC + niveau + message
- ✓Sortie sur stderr, file sink optionnel (ajout en fin de fichier, sans rotation)
- ✓Niveau minimal réglé par
Log.SetMinLevel("warn") - ✓
Log.Raw(line)écrit une ligne telle quelle, par exemple du JSON (v0.2)
Exemple
Exemple minimal d'utilisation — recopiable tel quel après l'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") // facultatif : ajoute aussi chaque ligne à un fichier
Log.Debug("hidden at info level")
Log.Info("server started on :8080")
Log.Warn("config file missing, using defaults")
Log.Error("db connection failed")
}
}
En bref
- Licence : Apache-2.0
- Installation :
amc package add logging - Code source : amalgame-lang/amalgame-logging
- Index officiel : amalgame-lang/packages-index