agpl_1.0.0_b5da3320/src/agpl-timed_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
with Ada.Finalization;
with Agpl.Chronos;
with Agpl.Trace;
with Agpl.Ustrings;

package Agpl.Timed_Log is

   type Object (<>) is tagged limited private;

   --  Logs the given text

   function Create (Text   : String;
                    Level  : Trace.Levels := Trace.Always;
                    Scoped : Boolean      := True) return Object;

   procedure Snapshot (This  : Object;
                       Step  : String := "BUSY";
                       Level : Trace.Levels := Trace.Always);

private

   use Agpl.Ustrings;

   type Object is new Ada.Finalization.Limited_Controlled with record
      Timer  : Chronos.Object;
      Text   : Ustring;
      Scoped : Boolean;
      Level  : Trace.Levels;
   end record;

   procedure Finalize (This : in out Object);

end Agpl.Timed_Log;