File: alog-log_request.ads

## Documentation

Table of Contents
Class Inheritance Tree

1.     --

2.     --  Copyright (c) 2009,

3.     --  Reto Buerki, Adrian-Ken Rueegsegger

4.     --

5.     --  This file is part of Alog.

6.     --

7.     --  Alog is free software; you can redistribute it and/or modify

8.     --  it under the terms of the GNU Lesser General Public License as published

9.     --  by the Free Software Foundation; either version 2.1 of the License, or

10.     --  (at your option) any later version.

11.     --

12.     --  Alog is distributed in the hope that it will be useful,

13.     --  but WITHOUT ANY WARRANTY; without even the implied warranty of

14.     --  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the

15.     --  GNU Lesser General Public License for more details.

16.     --

17.     --  You should have received a copy of the GNU Lesser General Public License

18.     --  along with Alog; if not, write to the Free Software

19.     --  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,

20.     --  MA  02110-1301  USA

21.     --

23.     with Ada.Task_Identification;

24.     with Ada.Strings.Unbounded;

26.     --  Log request type. Log request objects are used for asynchronous logging and

27.     --  hold all relevant information of a log request.

28.     package Alog.Log_RequestTo API docTo specTo body is

30.        use Ada.Task_Identification;

32.        type InstanceTo API docTo body is tagged private;

33.        --  A log request contains all related information to log asynchronously

34.        --  (Caller identification, loglevel and message).

36.        function CreateTo API docTo body

37.          (ID      : Task_Id   := Current_Task;

38.           Source  : String    := "";

39.           LevelTo API docTo body   : Log_LevelTo API docTo spec := Debug;

40.           Message : String)

41.           return InstanceTo API docTo specTo body;

42.        --  Create a log request object from the specified parameters.

44.        function Get_Caller_IDTo API docTo body (RequestTo API docTo body : InstanceTo API docTo specTo body) return Task_Id;

45.        --  Return the caller ID of the request object.

47.        function Get_SourceTo API docTo body (RequestTo API docTo body : InstanceTo API docTo specTo body) return String;

48.        --  Return the source of the request object.

50.        function Get_Log_LevelTo API docTo body (RequestTo API docTo body : InstanceTo API docTo specTo body) return Log_LevelTo API docTo spec;

51.        --  Return the loglevel of the request object.

53.        function Get_MessageTo API docTo body (RequestTo API docTo body : InstanceTo API docTo specTo body) return String;

54.        --  Return the log message of the request object.

56.     private

58.        type InstanceTo API docTo spec is tagged record

59.           Caller_ID : Task_Id   := Null_Task_Id;

60.           Source    : Ada.Strings.Unbounded.Unbounded_String;

61.           Level     : Log_LevelTo API docTo spec := Info;

62.           Message   : Ada.Strings.Unbounded.Unbounded_String;

63.        end record;

65.     end Alog.Log_RequestTo API docTo specTo body;