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--
22
23with Alog.Policy_DB;
24
25package body Alog.Dst_Filter is
26
27   Instance : Policy_DB.Protected_Policy_DB;
28
29   -------------------------------------------------------------------------
30
31   function Accept_ID
32     (Name  : String;
33      Level : Log_Level)
34      return Boolean is
35   begin
36      return Instance.Accept_ID (Identifier => Name, Level => Level);
37   end Accept_ID;
38
39   -------------------------------------------------------------------------
40
41   function Get_Default_Level return Log_Level is
42   begin
43      return Instance.Get_Default_Loglevel;
44   end Get_Default_Level;
45
46   -------------------------------------------------------------------------
47
48   function Get_Loglevel (Identifier : String) return Log_Level is
49   begin
50      return Instance.Get_Loglevel (Identifier => Identifier);
51   end Get_Loglevel;
52
53   -------------------------------------------------------------------------
54
55   function Lookup (Name : String) return Log_Level
56   is
57   begin
58      return Instance.Lookup (Identifier => Name);
59   end Lookup;
60
61   -------------------------------------------------------------------------
62
63   procedure Reset is
64   begin
65      Instance.Reset;
66   end Reset;
67
68   -------------------------------------------------------------------------
69
70   procedure Set_Default_Level (Level : Log_Level) is
71   begin
72      Instance.Set_Default_Loglevel (Level => Level);
73   end Set_Default_Level;
74
75   -------------------------------------------------------------------------
76
77   procedure Set_Loglevel
78     (Name  : String;
79      Level : Log_Level) is
80   begin
81      Instance.Set_Loglevel (Identifier => Name, Level => Level);
82   end Set_Loglevel;
83
84   -------------------------------------------------------------------------
85
86   procedure Set_Loglevel (Names : Maps.Wildcard_Level_Map) is
87   begin
88      Instance.Set_Loglevel (Identifiers => Names);
89   end Set_Loglevel;
90
91end Alog.Dst_Filter;
92