-
-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
93 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
with Alire.Utils; | ||
|
||
package body Alire.Warnings is | ||
|
||
Already_Emitted : Utils.String_Set; | ||
|
||
--------------- | ||
-- Warn_Once -- | ||
--------------- | ||
|
||
procedure Warn_Once (Text : String; | ||
ID : String := ""; | ||
Level : Trace.Levels := Trace.Warning) | ||
is | ||
begin | ||
if ID = "" then | ||
Warn_Once (Text, Text, Level); | ||
elsif not Already_Emitted.Contains (ID) then | ||
Already_Emitted.Include (ID); | ||
Trace.Log (Text, Level); | ||
end if; | ||
end Warn_Once; | ||
|
||
end Alire.Warnings; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package Alire.Warnings with Preelaborate is | ||
|
||
procedure Warn_Once (Text : String; | ||
ID : String := ""; | ||
Level : Trace.Levels := Trace.Warning); | ||
-- Emit a warning just once. If it has been already seen, do not warn | ||
-- again. ID is used to determine if a warning has already been emitted | ||
-- or, when not given, the actual warning text. | ||
|
||
end Alire.Warnings; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters