Migrated to Simple_Logging

This commit is contained in:
Jano at Zelda
2018-02-07 17:16:30 +01:00
parent 7b6077df69
commit 25667f9f95
4 changed files with 8 additions and 22 deletions
+1 -1
View File
@@ -18,7 +18,7 @@ project Alire is
package Compiler is
for Switches ("ada") use ("-gnatwa", "-gnatVa", "-g", "-O2", "-gnat12",
"-gnato", "-fstack-check", "-gnata");
"-gnato", "-fstack-check", "-gnata", "-fPIC");
end Compiler;
package Binder is
+1 -1
View File
@@ -25,7 +25,7 @@ package body Alire.Query is
use Containers.Project_Release_Maps;
begin
for Rel of I loop
Log (" " & Rel.Milestone_Image, Verbose);
Log (" " & Rel.Milestone_Image, Detail);
end loop;
end Print_Solution;
-16
View File
@@ -1,16 +0,0 @@
with GNAT.IO;
package body Alire is
procedure Log (S : String; Level : Verbosities := Terse) is
begin
if Level >= Verbosity then
GNAT.IO.Put_Line
((case Level is
when Terse => "",
when Verbose => "-> ",
when Debug => "-->> ") & S);
end if;
end Log;
end Alire;
+6 -4
View File
@@ -2,6 +2,8 @@ private with Ada.Containers.Indefinite_Holders;
with Semantic_Versioning;
with Simple_Logging;
package Alire with Preelaborate is
File_Error : exception;
@@ -33,13 +35,13 @@ package Alire with Preelaborate is
function Version (M : Milestone) return Semantic_Versioning.Version;
---------------
-- LOGGING --
---------------
type Verbosities is (Debug, Verbose, Terse);
use all type Simple_Logging.Levels;
Verbosity : Verbosities := Terse;
procedure Log (S : String; Level : Verbosities := Terse);
procedure Log (S : String; Level : Simple_Logging.Levels := Info) renames Simple_Logging.Log;
private