spat_1.3.0_4ad4ab14/src/util/spat-log.ads

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
------------------------------------------------------------------------------
--  Copyright (C) 2020 by Heisenbug Ltd. (gh+spat@heisenbug.eu)
--
--  This work is free. You can redistribute it and/or modify it under the
--  terms of the Do What The Fuck You Want To Public License, Version 2,
--  as published by Sam Hocevar. See the LICENSE file for more details.
------------------------------------------------------------------------------
pragma License (Unrestricted);

------------------------------------------------------------------------------
--
--  SPARK Proof Analysis Tool
--
--  S.P.A.T. - Message output utilities
--
------------------------------------------------------------------------------

with Ada.Exceptions;

package SPAT.Log is

   ---------------------------------------------------------------------------
   --  Warning
   --
   --  Print a warning message to Standard_Error.
   ---------------------------------------------------------------------------
   procedure Warning (Message : in String);

   ---------------------------------------------------------------------------
   --  Error
   --
   --  Print a error message to Standard_Error.
   ---------------------------------------------------------------------------
   procedure Error (Message : in String);

   ---------------------------------------------------------------------------
   --  Message
   --
   --  Print a message to Standard_Output.
   ---------------------------------------------------------------------------
   procedure Message (Message  : in String;
                      New_Line : in Boolean := True);

   ---------------------------------------------------------------------------
   --  Debug
   --
   --  Print a debug message to Standard_Output if the command line parameter
   --  --verbose is set.
   ---------------------------------------------------------------------------
   procedure Debug (Message  : in String;
                    New_Line : in Boolean := True);

   ---------------------------------------------------------------------------
   --  Debug_Enabled
   --
   --  Returns True if Debug would output something.
   ---------------------------------------------------------------------------
   function Debug_Enabled return Boolean;

   ---------------------------------------------------------------------------
   --  Dump_Exception
   --
   --  Print the error Message followed by exception information to
   --  Standard_Error.
   --
   --  The (symbolic) stacktrace only works if the binder option "-E" has been
   --  enabled when compiling the program.
   --
   --  The optional parameter File can be used to also print a file name, if
   --  the error may have been related to a file.
   ---------------------------------------------------------------------------
   procedure Dump_Exception (E       : in Ada.Exceptions.Exception_Occurrence;
                             Message : in String;
                             File    : in String := "");

end SPAT.Log;