1. -- 
  2. --  Copyright (c) 2008-2009, 
  3. --  Reto Buerki, Adrian-Ken Rueegsegger 
  4. --  secunet SwissIT AG 
  5. -- 
  6. --  This file is part of Alog. 
  7. -- 
  8. --  Alog is free software; you can redistribute it and/or modify 
  9. --  it under the terms of the GNU Lesser General Public License as published 
  10. --  by the Free Software Foundation; either version 2.1 of the License, or 
  11. --  (at your option) any later version. 
  12. -- 
  13. --  Alog is distributed in the hope that it will be useful, 
  14. --  but WITHOUT ANY WARRANTY; without even the implied warranty of 
  15. --  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
  16. --  GNU Lesser General Public License for more details. 
  17. -- 
  18. --  You should have received a copy of the GNU Lesser General Public License 
  19. --  along with Alog; if not, write to the Free Software 
  20. --  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, 
  21. --  MA  02110-1301  USA 
  22.  
  23. --  Syslog facility. Used to log to systems syslog. At the moment, this facility 
  24. --  is a thin binding to syslog function calls. The implementation attempts to 
  25. --  resemble the native libc-functions of your system, so that anyone being 
  26. --  familiar with syslog.h should be able to use this module right away. 
  27. package Alog.Facilities.Syslog is 
  28.  
  29.    type Instance is new Alog.Facilities.Instance with private; 
  30.    --  Syslog based logging facility. 
  31.  
  32.    type Handle is access all Instance; 
  33.  
  34.    type S_Facility is 
  35.      (LOG_AUTH, 
  36.       LOG_USER, 
  37.       LOG_MAIL, 
  38.       LOG_DAEMON, 
  39.       LOG_SYSLOG, 
  40.       LOG_CRON); 
  41.    --  Corresponding Ada-Implementation of syslogs "facility" parameter. 
  42.    --  Only the important/usable facilities are mapped. 
  43.  
  44.    for S_Facility use 
  45.      (LOG_AUTH   => 0, 
  46.       LOG_USER   => 8, 
  47.       LOG_MAIL   => 16, 
  48.       LOG_DAEMON => 24, 
  49.       LOG_SYSLOG => 40, 
  50.       LOG_CRON   => 72); 
  51.    --  Facility map table. 
  52.  
  53. private 
  54.  
  55.    overriding 
  56.    procedure Write 
  57.      (Facility : Instance; 
  58.       Level    : Log_Level := Info; 
  59.       Msg      : String); 
  60.    --  Implementation of the Write procedure for syslog. 
  61.  
  62.    type Instance is new Alog.Facilities.Instance with null record; 
  63.  
  64. end Alog.Facilities.Syslog;