init
This commit is contained in:
commit
7b4a1a6c1f
8 changed files with 296 additions and 0 deletions
37
tests/LoggerTest.Mod
Normal file
37
tests/LoggerTest.Mod
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
MODULE LoggerTest;
|
||||
|
||||
IMPORT Logger;
|
||||
|
||||
VAR
|
||||
log: Logger.Logger;
|
||||
|
||||
BEGIN
|
||||
(* Initialize logger instance *)
|
||||
log := Logger.New();
|
||||
|
||||
(* Show default level (INFO) in action *)
|
||||
log.Info("Logger initialized");
|
||||
log.InfoInt("Connected users: ", 42);
|
||||
|
||||
(* Prefix usage *)
|
||||
log.SetPrefix("unit-test");
|
||||
log.Warn("Warning with prefix");
|
||||
log.WarnInt("Sessions: ", 5);
|
||||
|
||||
log.Error("Something went wrong");
|
||||
log.ErrorInt("Error code: ", -7);
|
||||
|
||||
(* Switch to DEBUG level *)
|
||||
log.SetLevel(Logger.DEBUG);
|
||||
log.Debug("This is a debug message");
|
||||
log.DebugInt("File descriptor: ", 3);
|
||||
|
||||
(* Clear prefix *)
|
||||
log.ClearPrefix();
|
||||
log.Info("Prefix cleared");
|
||||
|
||||
(* Suppress all output *)
|
||||
log.SetLevel(-1);
|
||||
log.Error("This should NOT print");
|
||||
log.Debug("This should NOT print");
|
||||
END LoggerTest.
|
||||
Loading…
Add table
Add a link
Reference in a new issue