From 25667f9f95d194f3c34697ba252e6d1444a8c385 Mon Sep 17 00:00:00 2001 From: Jano at Zelda Date: Wed, 7 Feb 2018 17:16:30 +0100 Subject: [PATCH] Migrated to Simple_Logging --- alire.gpr | 2 +- src/alire-query.adb | 2 +- src/alire.adb | 16 ---------------- src/alire.ads | 10 ++++++---- 4 files changed, 8 insertions(+), 22 deletions(-) delete mode 100644 src/alire.adb diff --git a/alire.gpr b/alire.gpr index 476e43c8..15bb12d4 100644 --- a/alire.gpr +++ b/alire.gpr @@ -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 diff --git a/src/alire-query.adb b/src/alire-query.adb index 2af29e6a..208683c5 100644 --- a/src/alire-query.adb +++ b/src/alire-query.adb @@ -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; diff --git a/src/alire.adb b/src/alire.adb deleted file mode 100644 index c164b15a..00000000 --- a/src/alire.adb +++ /dev/null @@ -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; diff --git a/src/alire.ads b/src/alire.ads index 57ed17d5..922d58b4 100644 --- a/src/alire.ads +++ b/src/alire.ads @@ -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