Files
alire-index-community/deps/simple_logging/src/simple_logging.adb
T
Alejandro R. Mosteo 7b6077df69 Simple logging lib
2018-02-07 01:04:53 +01:00

25 lines
528 B
Ada

with GNAT.IO;
package body Simple_Logging is
function Prefix (Level : Levels) return String is
(case Level is
when Error => "ERROR: ",
when WARNING => "Warning: ",
when Info => "",
when Detail => "-> ",
when Debug => "-->> ");
---------
-- Log --
---------
procedure Log (S : String; Level : Levels := Info) is
begin
if Level <= Simple_Logging.Level then
GNAT.IO.Put_Line (Prefix (Level) & S);
end if;
end Log;
end Simple_Logging;