liblog4ada-1.2.orig/0000755000175000017500000000000011717262672014170 5ustar lbrentalbrentaliblog4ada-1.2.orig/utilities/0000755000175000017500000000000011717262672016203 5ustar lbrentalbrentaliblog4ada-1.2.orig/utilities/src/0000755000175000017500000000000011717262672016772 5ustar lbrentalbrentaliblog4ada-1.2.orig/utilities/src/generic_streaming.ads0000644000175000017500000000126511717262672023154 0ustar lbrentalbrentawith Ada.Streams; use Ada.Streams; with Ada.Unchecked_Deallocation; package Generic_Streaming is type Stream_Element_Array_Access is access Stream_Element_Array; procedure Free is new Ada.Unchecked_Deallocation (Stream_Element_Array, Stream_Element_Array_Access); type Basic_Stream is new Root_Stream_Type with record Data : Stream_Element_Array_Access := null; Cursor : Stream_Element_Offset; end record; procedure Read (Stream : in out Basic_Stream; Item : out Stream_Element_Array; Last : out Stream_Element_Offset); procedure Write (Stream : in out Basic_Stream; Item : Stream_Element_Array); end Generic_Streaming; liblog4ada-1.2.orig/utilities/src/generic_streaming.adb0000644000175000017500000000240611717262672023131 0ustar lbrentalbrentapackage body Generic_Streaming is ---------- -- Read -- ---------- procedure Read (Stream : in out Basic_Stream; Item : out Stream_Element_Array; Last : out Stream_Element_Offset) is begin Item := Stream.Data.all (Stream.Cursor .. Stream.Cursor + Item'Length - 1); Last := Item'Length; Stream.Cursor := Stream.Cursor + Item'Length; if Stream.Cursor > Stream.Data.all'Last then Free (Stream.Data); end if; end Read; ----------- -- Write -- ----------- procedure Write (Stream : in out Basic_Stream; Item : Stream_Element_Array) is begin if Stream.Data = null then Stream.Data := new Stream_Element_Array (1 .. Item'Length); Stream.Data.all := Item; else declare Temp : constant Stream_Element_Array := Stream.Data.all; begin Free (Stream.Data); Stream.Data := new Stream_Element_Array (1 .. Temp'Length + Item'Length); Stream.Data.all (1 .. Temp'Length) := Temp; Stream.Data.all (Temp'Length + 1 .. Temp'Length + Item'Length) := Item; end; end if; Stream.Cursor := 1; end Write; end Generic_Streaming; liblog4ada-1.2.orig/server/0000755000175000017500000000000011717262672015476 5ustar lbrentalbrentaliblog4ada-1.2.orig/server/src_annex_e/0000755000175000017500000000000011717262672017762 5ustar lbrentalbrentaliblog4ada-1.2.orig/server/src_annex_e/log4ada-appenders-annex_e.ads0000644000175000017500000000423511717262672025364 0ustar lbrentalbrenta------------------------------------------------------------------------------ -- Log4Ada -- -- -- -- Copyright (C) 2007 -- -- X. Grave CNRS -- -- -- -- This library is free software; you can redistribute it and/or modify -- -- it under the terms of the GNU General Public License as published by -- -- the Free Software Foundation; either version 2 of the License, or (at -- -- your option) any later version. -- -- -- -- This library is distributed in the hope that it will be useful, but -- -- WITHOUT ANY WARRANTY; without even the implied warranty of -- -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -- -- General Public License for more details. -- -- -- -- You should have received a copy of the GNU General Public License -- -- along with this library; if not, write to the Free Software Foundation, -- -- Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -- -- -- with Events_Receivers; package Log4ada.Appenders.Annex_E is type Remote_Appender_Type is new Appender_Type with private; procedure Append (Remote_Appender : not null access Remote_Appender_Type; Event : Events.Event_Type); procedure Set_Receiver (Remote_Appender : in out Remote_Appender_Type; Event_Receiver : Events_Receivers.Events_Receivers_Class_Access); No_Receiver : exception; private type Remote_Appender_Type is new Appender_Type with record Event_Receiver : Events_Receivers.Events_Receivers_Class_Access := null; end record; end Log4ada.Appenders.Annex_E; liblog4ada-1.2.orig/server/src_annex_e/log4ada-appenders-annex_e.adb0000644000175000017500000000576211717262672025351 0ustar lbrentalbrenta------------------------------------------------------------------------------ -- Log4Ada -- -- -- -- Copyright (C) 2007-2009 -- -- X. Grave CNRS -- -- -- -- This library is free software; you can redistribute it and/or modify -- -- it under the terms of the GNU General Public License as published by -- -- the Free Software Foundation; either version 2 of the License, or (at -- -- your option) any later version. -- -- -- -- This library is distributed in the hope that it will be useful, but -- -- WITHOUT ANY WARRANTY; without even the implied warranty of -- -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -- -- General Public License for more details. -- -- -- -- You should have received a copy of the GNU General Public License -- -- along with this library; if not, write to the Free Software Foundation, -- -- Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -- -- -- with System.RPC; package body Log4ada.Appenders.Annex_E is ------------ -- Append -- ------------ procedure Append (Remote_Appender : not null access Remote_Appender_Type; Event : Events.Event_Type) is use type Events_Receivers.Events_Receivers_Class_Access; begin if not Remote_Appender.Enabled then return; end if; if Remote_Appender.Event_Receiver = null then raise No_Receiver; end if; if not Continue (Remote_Appender, Event) then return; end if; declare Local_Receiver : constant Events_Receivers.Events_Receivers_Class_Access := Remote_Appender.Event_Receiver; begin Events_Receivers.Send_Event (Local_Receiver, Events.To_String (Event), Events_Receivers.Log4ada_Event); exception when System.RPC.Communication_Error => -- desabling remote logging Remote_Appender.Enabled := False; Remote_Appender.Event_Receiver := null; end; end Append; ------------------ -- Set_Receiver -- ------------------ procedure Set_Receiver (Remote_Appender : in out Remote_Appender_Type; Event_Receiver : Events_Receivers.Events_Receivers_Class_Access) is begin Remote_Appender.Event_Receiver := Event_Receiver; end Set_Receiver; end Log4ada.Appenders.Annex_E; liblog4ada-1.2.orig/server/src_annex_e/events_receivers.ads0000644000175000017500000000434411717262672024033 0ustar lbrentalbrenta------------------------------------------------------------------------------ -- Log4Ada -- -- -- -- Copyright (C) 2007 -- -- X. Grave CNRS -- -- -- -- This library is free software; you can redistribute it and/or modify -- -- it under the terms of the GNU General Public License as published by -- -- the Free Software Foundation; either version 2 of the License, or (at -- -- your option) any later version. -- -- -- -- This library is distributed in the hope that it will be useful, but -- -- WITHOUT ANY WARRANTY; without even the implied warranty of -- -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -- -- General Public License for more details. -- -- -- -- You should have received a copy of the GNU General Public License -- -- along with this library; if not, write to the Free Software Foundation, -- -- Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -- -- -- package Events_Receivers is pragma Remote_Types; type Supported_Events_Type is (Log4ada_Event, String_Event); type Events_Receiver_Type is abstract tagged limited private; type Events_Receivers_Class_Access is access all Events_Receiver_Type'Class; procedure Send_Event (Events_Receiver : not null access Events_Receiver_Type; Event : String; Event_Type : Supported_Events_Type := Log4ada_Event) is abstract; function Event_Receiver_Is_Alive (Events_Receiver : not null access Events_Receiver_Type) return Boolean; Event_Type_Not_Supported : exception; private type Events_Receiver_Type is abstract tagged limited null record; end Events_Receivers; liblog4ada-1.2.orig/server/src_annex_e/events_receivers.adb0000644000175000017500000000060311717262672024004 0ustar lbrentalbrentapackage body Events_Receivers is ----------------------------- -- Event_Receiver_Is_Alive -- ----------------------------- function Event_Receiver_Is_Alive (Events_Receiver : not null access Events_Receiver_Type) return Boolean is pragma Unreferenced (Events_Receiver); begin return True; end Event_Receiver_Is_Alive; end Events_Receivers; liblog4ada-1.2.orig/server/src_annex_e/events_receivers-local_consoles.ads0000644000175000017500000000511411717262672027024 0ustar lbrentalbrenta------------------------------------------------------------------------------ -- Log4Ada -- -- -- -- Copyright (C) 2007 -- -- X. Grave CNRS -- -- -- -- This library is free software; you can redistribute it and/or modify -- -- it under the terms of the GNU General Public License as published by -- -- the Free Software Foundation; either version 2 of the License, or (at -- -- your option) any later version. -- -- -- -- This library is distributed in the hope that it will be useful, but -- -- WITHOUT ANY WARRANTY; without even the implied warranty of -- -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -- -- General Public License for more details. -- -- -- -- You should have received a copy of the GNU General Public License -- -- along with this library; if not, write to the Free Software Foundation, -- -- Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -- -- -- with Log4ada.Appenders.Consoles; with Log4ada.Appenders.Files; with Log4ada.Loggers; package Events_Receivers.Local_Consoles is type Events_Display_Console_Type is new Events_Receiver_Type with private; procedure Send_Event (Events_Receiver : not null access Events_Display_Console_Type; Event : String; Event_Type : Supported_Events_Type := Log4ada_Event); procedure Initialise (Receiver : in out Events_Display_Console_Type; Level : Log4ada.Level_Type; Local_File : Boolean := False; Local_File_Name : String := "local_log.txt"; File_Size : Log4ada.Appenders.Files.File_Size_Type := 16384); private type Events_Display_Console_Type is new Events_Receiver_Type with record Logger : aliased Log4ada.Loggers.Logger_Type; Console : aliased Log4ada.Appenders.Consoles.Console_Type; File : aliased Log4ada.Appenders.Files.File_Type; end record; end Events_Receivers.Local_Consoles; liblog4ada-1.2.orig/server/src_annex_e/events_receivers-local_consoles.adb0000644000175000017500000000611111717262672027001 0ustar lbrentalbrenta------------------------------------------------------------------------------ -- Log4Ada -- -- -- -- Copyright (C) 2007 -- -- X. Grave CNRS -- -- -- -- This library is free software; you can redistribute it and/or modify -- -- it under the terms of the GNU General Public License as published by -- -- the Free Software Foundation; either version 2 of the License, or (at -- -- your option) any later version. -- -- -- -- This library is distributed in the hope that it will be useful, but -- -- WITHOUT ANY WARRANTY; without even the implied warranty of -- -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -- -- General Public License for more details. -- -- -- -- You should have received a copy of the GNU General Public License -- -- along with this library; if not, write to the Free Software Foundation, -- -- Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -- -- -- with Log4ada.Events; package body Events_Receivers.Local_Consoles is ---------------- -- Send_Event -- ---------------- procedure Send_Event (Events_Receiver : not null access Events_Display_Console_Type; Event : String; Event_Type : Supported_Events_Type := Log4ada_Event) is Local_Event : Log4ada.Events.Event_Type; begin if Event_Type /= Log4ada_Event then raise Event_Type_Not_Supported; end if; Local_Event := Log4ada.Events.To_Event (Event); Log4ada.Loggers.Event_Out (Events_Receiver.Logger'Access, Local_Event); end Send_Event; procedure Initialise (Receiver : in out Events_Display_Console_Type; Level : Log4ada.Level_Type; Local_File : Boolean := False; Local_File_Name : String := "local_log.txt"; File_Size : Log4ada.Appenders.Files.File_Size_Type := 16384) is begin Log4ada.Loggers.Set_Level (Receiver.Logger'Access, Level); Log4ada.Loggers.Add_Appender (Receiver.Logger'Access, Receiver.Console'Unchecked_Access); if Local_File then Log4ada.Loggers.Add_Appender (Receiver.Logger'Access, Receiver.File'Unchecked_Access); Receiver.File.Set_File_Name (Local_File_Name); Receiver.File.Set_File_Max_Size (File_Size); end if; end Initialise; end Events_Receivers.Local_Consoles; liblog4ada-1.2.orig/server/src/0000755000175000017500000000000011717262672016265 5ustar lbrentalbrentaliblog4ada-1.2.orig/server/src/receiver_dictionnary.ads0000644000175000017500000000353011717262672023166 0ustar lbrentalbrenta------------------------------------------------------------------------------ -- Log4Ada -- -- -- -- Copyright (C) 2007 -- -- X. Grave CNRS -- -- -- -- This library is free software; you can redistribute it and/or modify -- -- it under the terms of the GNU General Public License as published by -- -- the Free Software Foundation; either version 2 of the License, or (at -- -- your option) any later version. -- -- -- -- This library is distributed in the hope that it will be useful, but -- -- WITHOUT ANY WARRANTY; without even the implied warranty of -- -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -- -- General Public License for more details. -- -- -- -- You should have received a copy of the GNU General Public License -- -- along with this library; if not, write to the Free Software Foundation, -- -- Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -- -- -- with Events_Receivers; package Receiver_Dictionnary is pragma Remote_Call_Interface; procedure Subscribe (Event_Receiver : Events_Receivers.Events_Receivers_Class_Access); function Get_Event_Receiver return Events_Receivers.Events_Receivers_Class_Access; end Receiver_Dictionnary; liblog4ada-1.2.orig/server/src/receiver_dictionnary.adb0000644000175000017500000000427711717262672023156 0ustar lbrentalbrenta------------------------------------------------------------------------------ -- Log4Ada -- -- -- -- Copyright (C) 2007 -- -- X. Grave CNRS -- -- -- -- This library is free software; you can redistribute it and/or modify -- -- it under the terms of the GNU General Public License as published by -- -- the Free Software Foundation; either version 2 of the License, or (at -- -- your option) any later version. -- -- -- -- This library is distributed in the hope that it will be useful, but -- -- WITHOUT ANY WARRANTY; without even the implied warranty of -- -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -- -- General Public License for more details. -- -- -- -- You should have received a copy of the GNU General Public License -- -- along with this library; if not, write to the Free Software Foundation, -- -- Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -- -- -- package body Receiver_Dictionnary is --------------- -- Subscribe -- --------------- Local_Event_Receiver : Events_Receivers.Events_Receivers_Class_Access; pragma Atomic (Local_Event_Receiver); procedure Subscribe (Event_Receiver : Events_Receivers.Events_Receivers_Class_Access) is begin Local_Event_Receiver := Event_Receiver; end Subscribe; ------------------------ -- Get_Event_Receiver -- ------------------------ function Get_Event_Receiver return Events_Receivers.Events_Receivers_Class_Access is begin return Local_Event_Receiver; end Get_Event_Receiver; end Receiver_Dictionnary; liblog4ada-1.2.orig/server/demos.gpr0000644000175000017500000000041311717262672017315 0ustar lbrentalbrentawith "../client/log4Ada.gpr"; with "../client/tests.gpr"; project demos is for Source_Dirs use ("src", "demos", "src_annex_e"); package Compiler is for Default_Switches ("ada") use log4Ada.Compiler'Default_Switches ("ada"); end compiler; end demos; liblog4ada-1.2.orig/server/demos/0000755000175000017500000000000011717262672016605 5ustar lbrentalbrentaliblog4ada-1.2.orig/server/demos/init_test_remote_logging.adb0000644000175000017500000000451411717262672024344 0ustar lbrentalbrenta------------------------------------------------------------------------------ -- Log4Ada -- -- -- -- Copyright (C) 2007 -- -- X. Grave CNRS -- -- -- -- This library is free software; you can redistribute it and/or modify -- -- it under the terms of the GNU General Public License as published by -- -- the Free Software Foundation; either version 2 of the License, or (at -- -- your option) any later version. -- -- -- -- This library is distributed in the hope that it will be useful, but -- -- WITHOUT ANY WARRANTY; without even the implied warranty of -- -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -- -- General Public License for more details. -- -- -- -- You should have received a copy of the GNU General Public License -- -- along with this library; if not, write to the Free Software Foundation, -- -- Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -- -- -- with Receiver_Dictionnary; with Events_Receivers; with Log4ada.Loggers; with Log4ada.Appenders.Annex_E; with Common_Output; with Options; procedure Init_Test_Remote_Logging is Event_Receiver : Events_Receivers.Events_Receivers_Class_Access; Logger : aliased Log4ada.Loggers.Logger_Type; Appender : aliased Log4ada.Appenders.Annex_E.Remote_Appender_Type; begin Log4ada.Loggers.Set_Name (Logger'Access, "joli logger"); Log4ada.Loggers.Set_Level (Logger'Access, Log4ada.Debug); Event_Receiver := Receiver_Dictionnary.Get_Event_Receiver; Log4ada.Appenders.Annex_E.Set_Receiver (Appender, Event_Receiver); Log4ada.Loggers.Add_Appender (Logger'Access, Appender'Unchecked_Access); Common_Output (Logger'Access, not Options.Present_Option ("loop")); end Init_Test_Remote_Logging; liblog4ada-1.2.orig/server/demos/init_collector_server.adb0000644000175000017500000000453511717262672023663 0ustar lbrentalbrenta------------------------------------------------------------------------------ -- Log4Ada -- -- -- -- Copyright (C) 2007 -- -- X. Grave CNRS -- -- -- -- This library is free software; you can redistribute it and/or modify -- -- it under the terms of the GNU General Public License as published by -- -- the Free Software Foundation; either version 2 of the License, or (at -- -- your option) any later version. -- -- -- -- This library is distributed in the hope that it will be useful, but -- -- WITHOUT ANY WARRANTY; without even the implied warranty of -- -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -- -- General Public License for more details. -- -- -- -- You should have received a copy of the GNU General Public License -- -- along with this library; if not, write to the Free Software Foundation, -- -- Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -- -- -- with Receiver_Dictionnary; with Log4ada; with Events_Receivers.Local_Consoles; with Options; procedure Init_Collector_Server is Local_Receiver : aliased Events_Receivers.Local_Consoles.Events_Display_Console_Type; begin if Options.Present_Option ("local_file") then Events_Receivers.Local_Consoles.Initialise (Receiver => Local_Receiver, Level => Log4ada.Debug, Local_File => True, Local_File_Name => "default_file_name.txt", File_Size => 2048); else Events_Receivers.Local_Consoles.Initialise (Receiver => Local_Receiver, Level => Log4ada.Debug); end if; Receiver_Dictionnary.Subscribe (Local_Receiver'Unchecked_Access); loop delay 100.0; end loop; end Init_Collector_Server; liblog4ada-1.2.orig/server/collector.cfg0000644000175000017500000000057511717262672020154 0ustar lbrentalbrentaconfiguration collector is pragma Starter (None); Collector_Server : partition := (receiver_dictionnary); procedure init_collector_server is in Collector_Server; test_remote_logging : partition; procedure init_test_remote_logging; for test_remote_logging'main use init_test_remote_logging; for test_remote_logging'termination use Local_Termination; end collector;liblog4ada-1.2.orig/server/GNUmakefile0000644000175000017500000000051011717262672017544 0ustar lbrentalbrentaARCH=$(shell uname -m) all:collector collector: po_gnatdist -p -P demos collector.cfg clean: rm -f `find . -name "*~"` rm -f `find . -name "*.o"` rm -f `find . -name "*.ali"` distclean:clean rm -Rf bin obj dsa collector_server test_remote_logging obj/$(ARCH): mkdir -p obj/$(ARCH) bin/$(ARCH): mkdir -p bin/$(ARCH) liblog4ada-1.2.orig/log4Ada_annex_e.gpr0000644000175000017500000000204111717262672017647 0ustar lbrentalbrenta-- Log4Ada library project file for use with GCC 4.4 and annex E -- Copyright (c) 2009 Xavier Grave -- -- This program is free software; you can redistribute it and/or modify -- it under the terms of the GNU General Public License as published by -- the Free Software Foundation; either version 3 of the License, or -- (at your option) any later version. -- -- This program is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- GNU General Public License for more details. -- -- This project file is designed to help build applications that use -- Log4Ada. Here is an example of how to use this project file: -- -- with "log4Ada_annex_e"; -- project Example is -- for Object_Dir use "obj"; -- for Exec_Dir use "."; -- for Main use ("example"); -- end Example; with "log4Ada"; project Log4Ada_Annex_E is for Source_Dirs use ("log4ada/annex_e"); end Log4Ada_Annex_E; liblog4ada-1.2.orig/log4Ada.gpr0000644000175000017500000000227111717262672016157 0ustar lbrentalbrenta-- Log4Ada library project file for use with GCC 4.4 -- Copyright (c) 2009 Xavier Grave -- -- This program is free software; you can redistribute it and/or modify -- it under the terms of the GNU General Public License as published by -- the Free Software Foundation; either version 3 of the License, or -- (at your option) any later version. -- -- This program is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- GNU General Public License for more details. -- -- This project file is designed to help build applications that use -- Log4Ada. Here is an example of how to use this project file: -- -- with "log4Ada"; -- project Example is -- for Object_Dir use "obj"; -- for Exec_Dir use "."; -- for Main use ("example"); -- end Example; with "xmlezout"; project Log4Ada is for Library_Name use "log4ada"; for Library_Dir use "../lib/log4ada"; for Library_Kind use "dynamic"; for Source_Dirs use ("log4ada"); for Library_ALI_Dir use "../lib/log4ada"; for Externally_Built use "true"; end Log4Ada; liblog4ada-1.2.orig/doc/0000755000175000017500000000000011717262672014735 5ustar lbrentalbrentaliblog4ada-1.2.orig/doc/log4Ada.tex0000644000175000017500000000365311717262672016741 0ustar lbrentalbrenta\documentclass[a4paper]{article} \usepackage{graphicx} \usepackage[colorlinks]{hyperref} \title{Log4Ada documentation} \author{X. Grave} \begin{document} \maketitle \tableofcontents \section*{Introduction} Log4Ada is a library written in the intend to ease logging in applications written in Ada. For more information about the logging scheme developed in this library see the log4j project~: \href{http://logging.apache.org/log4j/docs/}{Log4J} This documentation is in a very preliminary state. \section{Logging Levels} There is five level of logging~: \begin{itemize} \item Debug \item Info \item Warn \item Error \item Fatal \end{itemize} Associated to each level there is a procedure in the Log4ada.Loggers package~: \begin{itemize} \item Debug\_Out \item Info\_out \item Warn\_Out \item Error\_Out \item Fatal\_Out \end{itemize} All these procedures exists in two flavour, the first one with two parameters~: \begin{itemize} \item Logger which is a not null access Logger\_Type \item Message which is a String containing the information you want to log \end{itemize} The second one add a third parameter which is an Exception\_Occurrence. Log4Ada adds automatically the information extracted from the exception to the message. \section{Appenders} In order to have log out of the system, one needs to associate one or more appender to a Logger. This is done using the Add\_Appender procedure from the Log4ada.Loggers package. Log4Ada already provides a few appenders~: \begin{itemize} \item a console based one (Log4ada.Appenders.Consoles) \item logging to a file (Log4ada.Appenders.Files) \item logging to a log4j compatible tcp stream (Log4ada.Appenders.Tcp\_Stream) \subitem one can connect to \href{http://logging.apache.org/chainsaw/index.html}{chainsaw} for example. \item xml output (Log4ada.Appenders.Xml) \item Annex E logging facility to concentrate all logs from a distributed application (Log4ada.Appenders.Annex\_E) \end{itemize} \end{document} liblog4ada-1.2.orig/doc/GNUmakefile0000644000175000017500000000025411717262672017010 0ustar lbrentalbrenta.SUFFIXES: .aux .pdf .tex .tex.aux: pdflatex -draftmode $< .aux.pdf: pdflatex $*.tex doc:log4Ada.pdf clean: rm -f *~ *.aux *.pdf *.dvi *.log *.toc *.lof *.out *.bak liblog4ada-1.2.orig/client/0000755000175000017500000000000011717262672015446 5ustar lbrentalbrentaliblog4ada-1.2.orig/client/tests.gpr0000644000175000017500000000144611717262672017327 0ustar lbrentalbrentawith "log4Ada.gpr"; project tests is for Source_Dirs use ("demos"); case log4Ada.binaries is when "ppc" => for Object_Dir use "obj/ppc"; for Exec_Dir use "bin/ppc"; when "ppc64" => for Object_Dir use "obj/ppc64"; for Exec_Dir use "bin/ppc64"; when "i686" => for Object_Dir use "obj/i686"; for Exec_Dir use "bin/i686"; when "x86_64" => for Object_Dir use "obj/x86_64"; for Exec_Dir use "bin/x86_64"; end case; for main use ("test_console.adb", "test_file.adb", "test_socketappender.adb", "central_log_tcp.adb", "test_tcp_stream_appender.adb"); package Compiler is for Default_Switches ("ada") use ("-g", "-gnat05", "-gnatwa", "-gnatwy", "-gnatf", "-gnato"); end Compiler; end tests; liblog4ada-1.2.orig/client/src/0000755000175000017500000000000011717262672016235 5ustar lbrentalbrentaliblog4ada-1.2.orig/client/src/options.ads0000644000175000017500000000410111717262672020415 0ustar lbrentalbrenta------------------------------------------------------------------------------ -- Log4Ada -- -- -- -- Copyright (C) 2007-2011 -- -- X. Grave CNRS -- -- -- -- This library is free software; you can redistribute it and/or modify -- -- it under the terms of the GNU General Public License as published by -- -- the Free Software Foundation; either version 2 of the License, or (at -- -- your option) any later version. -- -- -- -- This library is distributed in the hope that it will be useful, but -- -- WITHOUT ANY WARRANTY; without even the implied warranty of -- -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -- -- General Public License for more details. -- -- -- -- You should have received a copy of the GNU General Public License -- -- along with this library; if not, write to the Free Software Foundation, -- -- Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -- -- package Options is function Present_Option (Option_Name : String) return Boolean; function Get_Option (Option_Name : String) return String; generic type Float_Number is digits <>; function Get_Float_Number (Option_Name : String) return Float_Number; generic type Integer_Number is range <>; function Get_Integer_Number (Option_Name : String) return Integer_Number; generic type Modular_Number is mod <>; function Get_Modular_Number (Option_Name : String) return Modular_Number; Non_Present_Option : exception; end Options; liblog4ada-1.2.orig/client/src/options.adb0000644000175000017500000000607411717262672020407 0ustar lbrentalbrenta------------------------------------------------------------------------------ -- Log4Ada -- -- -- -- Copyright (C) 2007-2009 -- -- X. Grave CNRS -- -- -- -- This library is free software; you can redistribute it and/or modify -- -- it under the terms of the GNU General Public License as published by -- -- the Free Software Foundation; either version 2 of the License, or (at -- -- your option) any later version. -- -- -- -- This library is distributed in the hope that it will be useful, but -- -- WITHOUT ANY WARRANTY; without even the implied warranty of -- -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -- -- General Public License for more details. -- -- -- -- You should have received a copy of the GNU General Public License -- -- along with this library; if not, write to the Free Software Foundation, -- -- Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -- -- with Ada.Command_Line; package body Options is function Present_Option (Option_Name : String) return Boolean is Extended_Option : constant String := "--" & Option_Name; begin for I in 1 .. Ada.Command_Line.Argument_Count loop if Ada.Command_Line.Argument (I) = Extended_Option then return True; end if; end loop; return False; end Present_Option; function Get_Option (Option_Name : String) return String is Extended_Option : constant String := "--" & Option_Name; begin for I in 1 .. Ada.Command_Line.Argument_Count loop if Ada.Command_Line.Argument (I) = Extended_Option then if I < Ada.Command_Line.Argument_Count then return Ada.Command_Line.Argument (I + 1); else raise Non_Present_Option with Option_Name & ": not present"; end if; end if; end loop; raise Non_Present_Option with Option_Name & ": not present"; end Get_Option; function Get_Float_Number (Option_Name : String) return Float_Number is begin return Float_Number'Value (Get_Option (Option_Name)); end Get_Float_Number; function Get_Integer_Number (Option_Name : String) return Integer_Number is begin return Integer_Number'Value (Get_Option (Option_Name)); end Get_Integer_Number; function Get_Modular_Number (Option_Name : String) return Modular_Number is begin return Modular_Number'Value (Get_Option (Option_Name)); end Get_Modular_Number; end Options; liblog4ada-1.2.orig/client/src/log4ada.ads0000644000175000017500000000324511717262672020245 0ustar lbrentalbrenta------------------------------------------------------------------------------ -- Log4Ada -- -- -- -- Copyright (C) 2007 -- -- X. Grave CNRS -- -- -- -- This library is free software; you can redistribute it and/or modify -- -- it under the terms of the GNU General Public License as published by -- -- the Free Software Foundation; either version 2 of the License, or (at -- -- your option) any later version. -- -- -- -- This library is distributed in the hope that it will be useful, but -- -- WITHOUT ANY WARRANTY; without even the implied warranty of -- -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -- -- General Public License for more details. -- -- -- -- You should have received a copy of the GNU General Public License -- -- along with this library; if not, write to the Free Software Foundation, -- -- Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -- -- -- package Log4ada is pragma Pure; type Level_Type is (All_Level, Debug, Info, Warn, Error, Fatal, Off); end Log4ada; liblog4ada-1.2.orig/client/src/log4ada-types.ads0000644000175000017500000000362311717262672021407 0ustar lbrentalbrenta------------------------------------------------------------------------------ -- Log4Ada -- -- -- -- Copyright (C) 2007 -- -- X. Grave CNRS -- -- -- -- This library is free software; you can redistribute it and/or modify -- -- it under the terms of the GNU General Public License as published by -- -- the Free Software Foundation; either version 2 of the License, or (at -- -- your option) any later version. -- -- -- -- This library is distributed in the hope that it will be useful, but -- -- WITHOUT ANY WARRANTY; without even the implied warranty of -- -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -- -- General Public License for more details. -- -- -- -- You should have received a copy of the GNU General Public License -- -- along with this library; if not, write to the Free Software Foundation, -- -- Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -- -- -- with Ada.Strings.Unbounded; package Log4ada.Types is type Base_Type is abstract tagged limited record Name : Ada.Strings.Unbounded.Unbounded_String; end record; procedure Set_Name (Base : not null access Base_Type; Name : String); function Get_Name (Base : not null access Base_Type) return String; end Log4ada.Types; liblog4ada-1.2.orig/client/src/log4ada-types.adb0000644000175000017500000000402611717262672021364 0ustar lbrentalbrenta------------------------------------------------------------------------------ -- Log4Ada -- -- -- -- Copyright (C) 2007 -- -- X. Grave CNRS -- -- -- -- This library is free software; you can redistribute it and/or modify -- -- it under the terms of the GNU General Public License as published by -- -- the Free Software Foundation; either version 2 of the License, or (at -- -- your option) any later version. -- -- -- -- This library is distributed in the hope that it will be useful, but -- -- WITHOUT ANY WARRANTY; without even the implied warranty of -- -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -- -- General Public License for more details. -- -- -- -- You should have received a copy of the GNU General Public License -- -- along with this library; if not, write to the Free Software Foundation, -- -- Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -- -- -- package body Log4ada.Types is use Ada.Strings.Unbounded; -------------- -- Set_Name -- -------------- procedure Set_Name (Base : not null access Base_Type; Name : String) is begin Base.Name := To_Unbounded_String (Name); end Set_Name; -------------- -- Get_Name -- -------------- function Get_Name (Base : not null access Base_Type) return String is begin return To_String (Base.Name); end Get_Name; end Log4ada.Types; liblog4ada-1.2.orig/client/src/log4ada-socket_utilities.ads0000644000175000017500000000417411717262672023630 0ustar lbrentalbrenta------------------------------------------------------------------------------ -- Log4Ada -- -- -- -- Copyright (C) 2007 -- -- X. Grave CNRS -- -- -- -- This library is free software; you can redistribute it and/or modify -- -- it under the terms of the GNU General Public License as published by -- -- the Free Software Foundation; either version 2 of the License, or (at -- -- your option) any later version. -- -- -- -- This library is distributed in the hope that it will be useful, but -- -- WITHOUT ANY WARRANTY; without even the implied warranty of -- -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -- -- General Public License for more details. -- -- -- -- You should have received a copy of the GNU General Public License -- -- along with this library; if not, write to the Free Software Foundation, -- -- Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -- -- -- with Ada.Text_IO; with GNAT.Sockets; package Log4ada.Socket_Utilities is procedure Open_Server_Link (Host : String; Port : GNAT.Sockets.Port_Type); function Get_Link return GNAT.Sockets.Socket_Type; procedure Put (Socket : in GNAT.Sockets.Socket_Type; S : String); procedure New_Line (Socket : in GNAT.Sockets.Socket_Type; Spacing : in Ada.Text_IO.Positive_Count := 1); procedure Close_Server_Link (Socket : GNAT.Sockets.Socket_Type) renames GNAT.Sockets.Close_Socket; end Log4ada.Socket_Utilities; liblog4ada-1.2.orig/client/src/log4ada-socket_utilities.adb0000644000175000017500000001243711717262672023610 0ustar lbrentalbrenta------------------------------------------------------------------------------ -- Log4Ada -- -- -- -- Copyright (C) 2007 -- -- X. Grave CNRS -- -- -- -- This library is free software; you can redistribute it and/or modify -- -- it under the terms of the GNU General Public License as published by -- -- the Free Software Foundation; either version 2 of the License, or (at -- -- your option) any later version. -- -- -- -- This library is distributed in the hope that it will be useful, but -- -- WITHOUT ANY WARRANTY; without even the implied warranty of -- -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -- -- General Public License for more details. -- -- -- -- You should have received a copy of the GNU General Public License -- -- along with this library; if not, write to the Free Software Foundation, -- -- Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -- -- -- with Ada.Unchecked_Conversion; with Ada.Streams; with Ada.Strings.Unbounded; with Ada.Exceptions; package body Log4ada.Socket_Utilities is ---------------------- -- Open_Server_Link -- ---------------------- Local_Socket : GNAT.Sockets.Socket_Type; Host_Memory : Ada.Strings.Unbounded.Unbounded_String := Ada.Strings.Unbounded.Null_Unbounded_String; Port_Memory : GNAT.Sockets.Port_Type := 0; Socket_Error_Raised : Boolean := False; procedure Open_Server_Link (Host : String; Port : GNAT.Sockets.Port_Type) is use GNAT.Sockets; use Ada.Streams; Address : GNAT.Sockets.Sock_Addr_Type; use type Ada.Strings.Unbounded.Unbounded_String; begin if Host_Memory = Ada.Strings.Unbounded.Null_Unbounded_String then Host_Memory := Ada.Strings.Unbounded.To_Unbounded_String (Host); Port_Memory := Port; end if; Address.Addr := GNAT.Sockets.Addresses (GNAT.Sockets.Get_Host_By_Name (Ada.Strings.Unbounded.To_String (Host_Memory)), 1); Address.Port := Port_Memory; GNAT.Sockets.Create_Socket (Local_Socket); GNAT.Sockets.Set_Socket_Option (Local_Socket, GNAT.Sockets.Socket_Level, (GNAT.Sockets.Reuse_Address, True)); GNAT.Sockets.Connect_Socket (Local_Socket, Address); exception when GNAT.Sockets.Host_Error | GNAT.Sockets.Socket_Error => Socket_Error_Raised := True; GNAT.Sockets.Close_Socket (Local_Socket); when E : others => Ada.Text_IO.Put ("log4ada socket utilities DBG : open server link=>"); Ada.Text_IO.Put_Line (Ada.Exceptions.Exception_Name (E)); raise; end Open_Server_Link; function Get_Link return GNAT.Sockets.Socket_Type is begin return Local_Socket; end Get_Link; --------- -- Put -- --------- procedure Put (Socket : in GNAT.Sockets.Socket_Type; S : String) is use type Ada.Streams.Stream_Element_Offset; First : Ada.Streams.Stream_Element_Offset; Index : Ada.Streams.Stream_Element_Offset; Max : Ada.Streams.Stream_Element_Offset; use GNAT.Sockets; begin if S = "" then return; end if; if Socket_Error_Raised then Socket_Error_Raised := False; Open_Server_Link (Ada.Strings.Unbounded.To_String (Host_Memory), Port_Memory); if Socket_Error_Raised then return; end if; end if; declare subtype Local_String is String (S'First .. S'Last); subtype Local_Stream_Array is Ada.Streams.Stream_Element_Array (Ada.Streams.Stream_Element_Offset (S'First) .. Ada.Streams.Stream_Element_Offset (S'Last)); function To_Stream is new Ada.Unchecked_Conversion (Local_String, Local_Stream_Array); Data : constant Local_Stream_Array := To_Stream (S); begin First := Data'First; Index := First - 1; Max := Data'Last; Send_Socket (Socket, Data (First .. Max), Index); exception when GNAT.Sockets.Socket_Error => Socket_Error_Raised := True; Close_Socket (Socket); when E : others => Ada.Text_IO.Put_Line ("log4ada socket utilities DBG : put=>" & Ada.Exceptions.Exception_Name (E)); raise; end; end Put; -------------- -- New_Line -- -------------- procedure New_Line (Socket : in GNAT.Sockets.Socket_Type; Spacing : in Ada.Text_IO.Positive_Count := 1) is begin for I in 1 .. Spacing loop Put (Socket, (1 => ASCII.LF)); end loop; end New_Line; end Log4ada.Socket_Utilities; liblog4ada-1.2.orig/client/src/log4ada-loggers.ads0000644000175000017500000001077011717262672021706 0ustar lbrentalbrenta------------------------------------------------------------------------------ -- Log4Ada -- -- -- -- Copyright (C) 2007 -- -- X. Grave CNRS -- -- -- -- This library is free software; you can redistribute it and/or modify -- -- it under the terms of the GNU General Public License as published by -- -- the Free Software Foundation; either version 2 of the License, or (at -- -- your option) any later version. -- -- -- -- This library is distributed in the hope that it will be useful, but -- -- WITHOUT ANY WARRANTY; without even the implied warranty of -- -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -- -- General Public License for more details. -- -- -- -- You should have received a copy of the GNU General Public License -- -- along with this library; if not, write to the Free Software Foundation, -- -- Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -- -- -- with Ada.Containers.Vectors; with Ada.Exceptions; with Log4ada.Appenders; with Log4ada.Events; with Log4ada.Types; package Log4ada.Loggers is type Logger_Type is new Types.Base_Type with private; type Logger_Class_Access is access all Logger_Type'Class; type Logger_Access is access all Logger_Type; procedure Set_Level (Logger : not null access Logger_Type; New_Level : Level_Type); function Get_Level (Logger : not null access Logger_Type) return Level_Type; procedure Add_Appender (Logger : not null access Logger_Type; Appender : Appenders.Appender_Class_Access); procedure Event_Out (Logger : not null access Logger_Type; Event : Events.Event_Type); procedure Debug_Out (Logger : not null access Logger_Type; Message : String; Exception_To_Send : Ada.Exceptions.Exception_Occurrence); procedure Info_Out (Logger : not null access Logger_Type; Message : String; Exception_To_Send : Ada.Exceptions.Exception_Occurrence); procedure Warn_Out (Logger : not null access Logger_Type; Message : String; Exception_To_Send : Ada.Exceptions.Exception_Occurrence); procedure Error_Out (Logger : not null access Logger_Type; Message : String; Exception_To_Send : Ada.Exceptions.Exception_Occurrence); procedure Fatal_Out (Logger : not null access Logger_Type; Message : String; Exception_To_Send : Ada.Exceptions.Exception_Occurrence); procedure Debug_Out (Logger : not null access Logger_Type; Message : String); procedure Info_Out (Logger : not null access Logger_Type; Message : String); procedure Warn_Out (Logger : not null access Logger_Type; Message : String); procedure Error_Out (Logger : not null access Logger_Type; Message : String); procedure Fatal_Out (Logger : not null access Logger_Type; Message : String); No_Appender : exception; procedure Logger_Output (Logger : not null access Logger_Type; Message : String; Level : Level_Type; Exception_To_Send : Ada.Exceptions.Exception_Occurrence); procedure Logger_Output (Logger : not null access Logger_Type; Message : String; Level : Level_Type); procedure Set_Lock_Delay (Logger : not null access Logger_Type; Lock_Delay : Duration); private package Appenders_Vector is new Ada.Containers.Vectors (Positive, Appenders.Appender_Class_Access, Appenders."="); use Appenders_Vector; protected type Lock_Type is entry Get; procedure Release; private Available : Boolean := True; end Lock_Type; type Logger_Type is new Types.Base_Type with record Current_Level : Level_Type := Off; Appenders_List : Vector; Lock : Lock_Type; Lock_Delay : Duration := 1.0; end record; end Log4ada.Loggers; liblog4ada-1.2.orig/client/src/log4ada-loggers.adb0000644000175000017500000002473611717262672021674 0ustar lbrentalbrenta------------------------------------------------------------------------------ -- Log4Ada -- -- -- -- Copyright (C) 2007 -- -- X. Grave CNRS -- -- -- -- This library is free software; you can redistribute it and/or modify -- -- it under the terms of the GNU General Public License as published by -- -- the Free Software Foundation; either version 2 of the License, or (at -- -- your option) any later version. -- -- -- -- This library is distributed in the hope that it will be useful, but -- -- WITHOUT ANY WARRANTY; without even the implied warranty of -- -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -- -- General Public License for more details. -- -- -- -- You should have received a copy of the GNU General Public License -- -- along with this library; if not, write to the Free Software Foundation, -- -- Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -- -- -- with Ada.Strings.Unbounded; with Ada.Task_Identification; with System; package body Log4ada.Loggers is use Ada.Task_Identification; use Ada.Strings.Unbounded; --------------- -- Set_Level -- --------------- procedure Set_Level (Logger : not null access Logger_Type; New_Level : Level_Type) is begin Logger.Current_Level := New_Level; end Set_Level; --------------- -- Get_Level -- --------------- function Get_Level (Logger : not null access Logger_Type) return Level_Type is begin return Logger.Current_Level; end Get_Level; ------------------ -- Add_Appender -- ------------------ procedure Add_Appender (Logger : not null access Logger_Type; Appender : Appenders.Appender_Class_Access) is begin Append (Logger.Appenders_List, Appender); end Add_Appender; --------------- -- Debug_Out -- --------------- type Struct_Timeval is record Seconds : Integer; Micro_Seconds : Integer; end record; pragma Convention (C, Struct_Timeval); function Get_Time_Of_Day (Data : access Struct_Timeval; Tz : System.Address := System.Null_Address) return Integer; pragma Import (C, Get_Time_Of_Day, "gettimeofday"); procedure Get_Time_Of_Day (Data : access Struct_Timeval); procedure Get_Time_Of_Day (Data : access Struct_Timeval) is Fct_Return : Integer; C_Code_Problem : exception; begin Fct_Return := Get_Time_Of_Day (Data); if Fct_Return /= 0 then raise C_Code_Problem; end if; end Get_Time_Of_Day; procedure Event_Out (Logger : not null access Logger_Type; Event : Events.Event_Type) is Index : Positive; List_Length : Positive; Appender : Appenders.Appender_Class_Access; Timestamp : Integer; Time_Value : aliased Struct_Timeval; begin if Logger.Lock_Delay = 0.0 then Logger.Lock.Get; else select Logger.Lock.Get; or delay Logger.Lock_Delay; return; end select; end if; if Logger.Current_Level > Events.Get_Level (Event) then Logger.Lock.Release; return; end if; if Is_Empty (Logger.Appenders_List) then Logger.Lock.Release; raise No_Appender; end if; Get_Time_Of_Day (Time_Value'Access); Timestamp := Time_Value.Seconds; if Events.First_Event_Timestamp = 0 then Events.First_Event_Timestamp := Timestamp; end if; Index := First_Index (Logger.Appenders_List); List_Length := Integer (Length (Logger.Appenders_List)); for I in Index .. Index + List_Length - 1 loop Appender := Element (Logger.Appenders_List, I); Appenders.Append (Appender, Event); end loop; Logger.Lock.Release; exception when others => Logger.Lock.Release; end Event_Out; procedure Logger_Output (Logger : not null access Logger_Type; Message : String; Level : Level_Type; Exception_To_Send : Ada.Exceptions.Exception_Occurrence) is Event : Events.Event_Type; List_Length : Positive; Appender : Appenders.Appender_Class_Access; Index : Positive; Timestamp : Integer; Time_Value : aliased Struct_Timeval; begin if Logger.Lock_Delay = 0.0 then Logger.Lock.Get; else select Logger.Lock.Get; or delay Logger.Lock_Delay; return; end select; end if; if Logger.Current_Level > Level then return; end if; if Is_Empty (Logger.Appenders_List) then raise No_Appender; end if; Get_Time_Of_Day (Time_Value'Access); Timestamp := Time_Value.Seconds; if Events.First_Event_Timestamp = 0 then Events.First_Event_Timestamp := Timestamp; end if; Event := Events.New_Event (Image (Current_Task), To_String (Logger.Name), Level, Timestamp, Message, Exception_To_Send); Index := First_Index (Logger.Appenders_List); List_Length := Integer (Length (Logger.Appenders_List)); for I in Index .. Index + List_Length - 1 loop Appender := Element (Logger.Appenders_List, I); Appenders.Append (Appender, Event); end loop; Logger.Lock.Release; exception when others => Logger.Lock.Release; end Logger_Output; procedure Logger_Output (Logger : not null access Logger_Type; Message : String; Level : Level_Type) is Event : Events.Event_Type; List_Length : Positive; Appender : Appenders.Appender_Class_Access; Index : Positive; Timestamp : Integer; Time_Value : aliased Struct_Timeval; begin if Logger.Lock_Delay = 0.0 then Logger.Lock.Get; else select Logger.Lock.Get; or delay Logger.Lock_Delay; return; end select; end if; if Logger.Current_Level > Level then Logger.Lock.Release; return; end if; if Is_Empty (Logger.Appenders_List) then Logger.Lock.Release; raise No_Appender; end if; Get_Time_Of_Day (Time_Value'Access); Timestamp := Time_Value.Seconds; if Events.First_Event_Timestamp = 0 then Events.First_Event_Timestamp := Timestamp; end if; Event := Events.New_Event (Image (Current_Task), To_String (Logger.Name), Level, Timestamp, Message); Index := First_Index (Logger.Appenders_List); List_Length := Integer (Length (Logger.Appenders_List)); for I in Index .. Index + List_Length - 1 loop Appender := Element (Logger.Appenders_List, I); Appenders.Append (Appender, Event); end loop; Logger.Lock.Release; exception when others => Logger.Lock.Release; end Logger_Output; procedure Set_Lock_Delay (Logger : not null access Logger_Type; Lock_Delay : Duration) is begin Logger.Lock_Delay := Lock_Delay; end Set_Lock_Delay; procedure Debug_Out (Logger : not null access Logger_Type; Message : String; Exception_To_Send : Ada.Exceptions.Exception_Occurrence) is begin Logger_Output (Logger, Message, Debug, Exception_To_Send); end Debug_Out; -------------- -- Info_Out -- -------------- procedure Info_Out (Logger : not null access Logger_Type; Message : String; Exception_To_Send : Ada.Exceptions.Exception_Occurrence) is begin Logger_Output (Logger, Message, Info, Exception_To_Send); end Info_Out; -------------- -- Warn_Out -- -------------- procedure Warn_Out (Logger : not null access Logger_Type; Message : String; Exception_To_Send : Ada.Exceptions.Exception_Occurrence) is begin Logger_Output (Logger, Message, Warn, Exception_To_Send); end Warn_Out; --------------- -- Error_Out -- --------------- procedure Error_Out (Logger : not null access Logger_Type; Message : String; Exception_To_Send : Ada.Exceptions.Exception_Occurrence) is begin Logger_Output (Logger, Message, Error, Exception_To_Send); end Error_Out; --------------- -- Fatal_Out -- --------------- procedure Fatal_Out (Logger : not null access Logger_Type; Message : String; Exception_To_Send : Ada.Exceptions.Exception_Occurrence) is begin Logger_Output (Logger, Message, Fatal, Exception_To_Send); end Fatal_Out; procedure Debug_Out (Logger : not null access Logger_Type; Message : String) is begin Logger_Output (Logger, Message, Debug); end Debug_Out; procedure Info_Out (Logger : not null access Logger_Type; Message : String) is begin Logger_Output (Logger, Message, Info); end Info_Out; procedure Warn_Out (Logger : not null access Logger_Type; Message : String) is begin Logger_Output (Logger, Message, Warn); end Warn_Out; procedure Error_Out (Logger : not null access Logger_Type; Message : String) is begin Logger_Output (Logger, Message, Error); end Error_Out; procedure Fatal_Out (Logger : not null access Logger_Type; Message : String) is begin Logger_Output (Logger, Message, Fatal); end Fatal_Out; protected body Lock_Type is entry Get when Available is begin Available := False; end Get; procedure Release is begin Available := True; end Release; end Lock_Type; end Log4ada.Loggers; liblog4ada-1.2.orig/client/src/log4ada-filters.ads0000644000175000017500000000445211717262672021714 0ustar lbrentalbrenta------------------------------------------------------------------------------ -- Log4Ada -- -- -- -- Copyright (C) 2007 -- -- X. Grave CNRS -- -- -- -- This library is free software; you can redistribute it and/or modify -- -- it under the terms of the GNU General Public License as published by -- -- the Free Software Foundation; either version 2 of the License, or (at -- -- your option) any later version. -- -- -- -- This library is distributed in the hope that it will be useful, but -- -- WITHOUT ANY WARRANTY; without even the implied warranty of -- -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -- -- General Public License for more details. -- -- -- -- You should have received a copy of the GNU General Public License -- -- along with this library; if not, write to the Free Software Foundation, -- -- Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -- -- -- with Ada.Containers.Vectors; with Log4ada.Events; with Log4ada.Types; package Log4ada.Filters is type Decision_Type is (Accept_Event, Neutral, Deny); type Filter_Type is abstract new Types.Base_Type with private; subtype Filter_Class is Filter_Type'Class; type Filter_Access is access all Filter_Type; type Filter_Class_Access is access all Filter_Type'Class; function Decide (Filter : not null access Filter_Type; Event : Events.Event_Type) return Decision_Type is abstract; package Vectors is new Ada.Containers.Vectors (Positive, Filter_Class_Access); private type Filter_Type is abstract new Types.Base_Type with null record; end Log4ada.Filters; liblog4ada-1.2.orig/client/src/log4ada-events.ads0000644000175000017500000000761311717262672021552 0ustar lbrentalbrenta------------------------------------------------------------------------------ -- Log4Ada -- -- -- -- Copyright (C) 2007 - 2009 -- -- X. Grave CNRS -- -- -- -- This library is free software; you can redistribute it and/or modify -- -- it under the terms of the GNU General Public License as published by -- -- the Free Software Foundation; either version 2 of the License, or (at -- -- your option) any later version. -- -- -- -- This library is distributed in the hope that it will be useful, but -- -- WITHOUT ANY WARRANTY; without even the implied warranty of -- -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -- -- General Public License for more details. -- -- -- -- You should have received a copy of the GNU General Public License -- -- along with this library; if not, write to the Free Software Foundation, -- -- Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -- -- -- with Ada.Strings.Unbounded; with Ada.Exceptions; package Log4ada.Events is type Event_Type is private; type Event_Access is access all Event_Type; function New_Event (Location_Information : String; Logger_Name : String; Level : Level_Type; Timestamp : Integer; Message : String; Exception_To_Send : Ada.Exceptions.Exception_Occurrence) return Event_Type; function New_Event (Location_Information : String; Logger_Name : String; Level : Level_Type; Timestamp : Integer; Message : String) return Event_Type; pragma Inline (New_Event); function Get_Location_Information (Event : Event_Type) return String; pragma Inline (Get_Location_Information); function Get_Logger_Name (Event : Event_Type) return String; pragma Inline (Get_Logger_Name); function Get_Level (Event : Event_Type) return Level_Type; pragma Inline (Get_Level); function Get_Timestamp (Event : Event_Type) return Integer; pragma Inline (Get_Timestamp); function Get_Message (Event : Event_Type) return String; pragma Inline (Get_Message); function Exception_Present (Event : Event_Type) return Boolean; pragma Inline (Exception_Present); function Get_Exception_Name (Event : Event_Type) return String; pragma Inline (Get_Exception_Name); function Get_Exception_Message (Event : Event_Type) return String; pragma Inline (Get_Exception_Message); First_Event_Timestamp : Integer := 0; pragma Atomic (First_Event_Timestamp); function To_Event (Event_String : String) return Event_Type; function To_String (Event : Event_Type) return String; private type Event_Type is tagged record Name : Ada.Strings.Unbounded.Unbounded_String; Location_Information : Ada.Strings.Unbounded.Unbounded_String; Level : Level_Type := Off; Timestamp : Integer := 0; Message : Ada.Strings.Unbounded.Unbounded_String; Logger_Name : Ada.Strings.Unbounded.Unbounded_String; Exception_Present : Boolean := False; Exception_To_Send_Name : Ada.Strings.Unbounded.Unbounded_String; Exception_To_Send_Message : Ada.Strings.Unbounded.Unbounded_String; end record; end Log4ada.Events; liblog4ada-1.2.orig/client/src/log4ada-events.adb0000644000175000017500000002165011717262672021526 0ustar lbrentalbrenta------------------------------------------------------------------------------ -- Log4Ada -- -- -- -- Copyright (C) 2007 -- -- X. Grave CNRS -- -- -- -- This library is free software; you can redistribute it and/or modify -- -- it under the terms of the GNU General Public License as published by -- -- the Free Software Foundation; either version 2 of the License, or (at -- -- your option) any later version. -- -- -- -- This library is distributed in the hope that it will be useful, but -- -- WITHOUT ANY WARRANTY; without even the implied warranty of -- -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -- -- General Public License for more details. -- -- -- -- You should have received a copy of the GNU General Public License -- -- along with this library; if not, write to the Free Software Foundation, -- -- Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -- -- -- package body Log4ada.Events is use Ada.Strings.Unbounded; use Ada.Exceptions; Event_Name : constant Unbounded_String := To_Unbounded_String ("log4ada:event"); --------------- -- New_Event -- --------------- function New_Event (Location_Information : String; Logger_Name : String; Level : Level_Type; Timestamp : Integer; Message : String) return Event_Type is begin return (Name => Event_Name, Location_Information => To_Unbounded_String (Location_Information), Logger_Name => To_Unbounded_String (Logger_Name), Level => Level, Timestamp => Timestamp, Message => To_Unbounded_String (Message), Exception_Present => False, Exception_To_Send_Name => Null_Unbounded_String, Exception_To_Send_Message => Null_Unbounded_String); end New_Event; function New_Event (Location_Information : String; Logger_Name : String; Level : Level_Type; Timestamp : Integer; Message : String; Exception_To_Send : Ada.Exceptions.Exception_Occurrence) return Event_Type is begin return (Name => Event_Name, Location_Information => To_Unbounded_String (Location_Information), Logger_Name => To_Unbounded_String (Logger_Name), Level => Level, Timestamp => Timestamp, Message => To_Unbounded_String (Message), Exception_Present => True, Exception_To_Send_Name => To_Unbounded_String (Exception_Name (Exception_To_Send)), Exception_To_Send_Message => To_Unbounded_String (Exception_Message (Exception_To_Send))); end New_Event; ------------------------------ -- Get_Location_Information -- ------------------------------ function Get_Location_Information (Event : Event_Type) return String is begin return To_String (Event.Location_Information); end Get_Location_Information; function Get_Logger_Name (Event : Event_Type) return String is begin return To_String (Event.Logger_Name); end Get_Logger_Name; --------------- -- Get_Level -- --------------- function Get_Level (Event : Event_Type) return Level_Type is begin return Event.Level; end Get_Level; ------------------- -- Get_Timestamp -- ------------------- function Get_Timestamp (Event : Event_Type) return Integer is begin return Event.Timestamp; end Get_Timestamp; ----------------- -- Get_Message -- ----------------- function Get_Message (Event : Event_Type) return String is begin return To_String (Event.Message); end Get_Message; ------------------- -- Get_Exception -- ------------------- function Exception_Present (Event : Event_Type) return Boolean is begin return Event.Exception_Present; end Exception_Present; function Get_Exception_Name (Event : Event_Type) return String is begin return To_String (Event.Exception_To_Send_Name); end Get_Exception_Name; function Get_Exception_Message (Event : Event_Type) return String is begin return To_String (Event.Exception_To_Send_Message); end Get_Exception_Message; Event_Separator : constant String := ""; Missing_Separator : exception; function Get_First_Value (Work_Event_String : Unbounded_String) return String; function Get_First_Value_Unbounded (Work_Event_String : Unbounded_String) return Unbounded_String; procedure Cut_First_Value (Work_Event_String : in out Unbounded_String); function To_Event (Event_String : String) return Event_Type is Event : Event_Type; Work_Event_String : Unbounded_String := To_Unbounded_String (Event_String); begin Event.Name := Get_First_Value_Unbounded (Work_Event_String); Cut_First_Value (Work_Event_String); Event.Location_Information := Get_First_Value_Unbounded (Work_Event_String); Cut_First_Value (Work_Event_String); Event.Level := Level_Type'Value (Get_First_Value (Work_Event_String)); Cut_First_Value (Work_Event_String); Event.Timestamp := Integer'Value (Get_First_Value (Work_Event_String)); Cut_First_Value (Work_Event_String); Event.Message := Get_First_Value_Unbounded (Work_Event_String); Cut_First_Value (Work_Event_String); Event.Logger_Name := Get_First_Value_Unbounded (Work_Event_String); Cut_First_Value (Work_Event_String); Event.Exception_Present := Boolean'Value (Get_First_Value (Work_Event_String)); if Event.Exception_Present then Cut_First_Value (Work_Event_String); Event.Exception_To_Send_Name := Get_First_Value_Unbounded (Work_Event_String); Cut_First_Value (Work_Event_String); Event.Exception_To_Send_Message := Get_First_Value_Unbounded (Work_Event_String); else Event.Exception_To_Send_Name := Null_Unbounded_String; Event.Exception_To_Send_Message := Null_Unbounded_String; end if; return Event; end To_Event; function To_String (Event : Event_Type) return String is String_To_Return : Unbounded_String := Event_Name; begin String_To_Return := String_To_Return & Event_Separator & Event.Location_Information; String_To_Return := String_To_Return & Event_Separator & Event.Level'Img; String_To_Return := String_To_Return & Event_Separator & Event.Timestamp'Img; String_To_Return := String_To_Return & Event_Separator & Event.Message; String_To_Return := String_To_Return & Event_Separator & Event.Logger_Name; String_To_Return := String_To_Return & Event_Separator & Event.Exception_Present'Img; String_To_Return := String_To_Return & Event_Separator & Event.Exception_To_Send_Name; String_To_Return := String_To_Return & Event_Separator & Event.Exception_To_Send_Message; return To_String (String_To_Return); end To_String; function Get_First_Value (Work_Event_String : Unbounded_String) return String is begin return To_String (Get_First_Value_Unbounded (Work_Event_String)); end Get_First_Value; function Get_First_Value_Unbounded (Work_Event_String : Unbounded_String) return Unbounded_String is Separator_Position : constant Natural := Index (Work_Event_String, Event_Separator); begin if Separator_Position = 0 then return Work_Event_String; end if; return Head (Work_Event_String, Separator_Position - 1); end Get_First_Value_Unbounded; procedure Cut_First_Value (Work_Event_String : in out Unbounded_String) is Separator_Position : constant Natural := Index (Work_Event_String, Event_Separator); begin if Separator_Position = 0 then raise Missing_Separator; end if; Tail (Work_Event_String, Length (Work_Event_String) - Separator_Position - Event_Separator'Length + 1); end Cut_First_Value; end Log4ada.Events; liblog4ada-1.2.orig/client/src/log4ada-appenders.ads0000644000175000017500000000527211717262672022226 0ustar lbrentalbrenta------------------------------------------------------------------------------ -- Log4Ada -- -- -- -- Copyright (C) 2007 -- -- X. Grave CNRS -- -- -- -- This library is free software; you can redistribute it and/or modify -- -- it under the terms of the GNU General Public License as published by -- -- the Free Software Foundation; either version 2 of the License, or (at -- -- your option) any later version. -- -- -- -- This library is distributed in the hope that it will be useful, but -- -- WITHOUT ANY WARRANTY; without even the implied warranty of -- -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -- -- General Public License for more details. -- -- -- -- You should have received a copy of the GNU General Public License -- -- along with this library; if not, write to the Free Software Foundation, -- -- Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -- -- -- with Log4ada.Filters; with Log4ada.Events; with Log4ada.Types; package Log4ada.Appenders is type Appender_Type is abstract new Types.Base_Type with private; type Appender_Class_Access is access all Appender_Type'Class; type Appender_Access is access all Appender_Type; procedure Add_Filter (Appender : not null access Appender_Type; Filter : Filters.Filter_Class_Access); procedure Clear_Filters (Appender : not null access Appender_Type); procedure Append (Appender : not null access Appender_Type; Event : Events.Event_Type) is abstract; procedure Disable (Appender : not null access Appender_Type); procedure Enable (Appender : not null access Appender_Type); function Enable_Status (Appender : not null access Appender_Type) return Boolean; private type Appender_Type is abstract new Types.Base_Type with record Filters_List : Filters.Vectors.Vector; Enabled : Boolean := True; end record; function Continue (Appender : not null access Appender_Type; Event : Events.Event_Type) return Boolean; end Log4ada.Appenders; liblog4ada-1.2.orig/client/src/log4ada-appenders.adb0000644000175000017500000000675311717262672022212 0ustar lbrentalbrenta------------------------------------------------------------------------------ -- Log4Ada -- -- -- -- Copyright (C) 2007 -- -- X. Grave CNRS -- -- -- -- This library is free software; you can redistribute it and/or modify -- -- it under the terms of the GNU General Public License as published by -- -- the Free Software Foundation; either version 2 of the License, or (at -- -- your option) any later version. -- -- -- -- This library is distributed in the hope that it will be useful, but -- -- WITHOUT ANY WARRANTY; without even the implied warranty of -- -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -- -- General Public License for more details. -- -- -- -- You should have received a copy of the GNU General Public License -- -- along with this library; if not, write to the Free Software Foundation, -- -- Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -- -- -- package body Log4ada.Appenders is use Filters.Vectors; ---------------- -- Add_Filter -- ---------------- procedure Add_Filter (Appender : not null access Appender_Type; Filter : Filters.Filter_Class_Access) is begin Append (Appender.Filters_List, Filter); end Add_Filter; ------------------- -- Clear_Filters -- ------------------- procedure Clear_Filters (Appender : not null access Appender_Type) is begin loop exit when Is_Empty (Appender.Filters_List); Delete_Last (Appender.Filters_List); end loop; end Clear_Filters; procedure Disable (Appender : not null access Appender_Type) is begin Appender.Enabled := False; end Disable; procedure Enable (Appender : not null access Appender_Type) is begin Appender.Enabled := True; end Enable; function Enable_Status (Appender : not null access Appender_Type) return Boolean is begin return Appender.Enabled; end Enable_Status; function Continue (Appender : not null access Appender_Type; Event : Events.Event_Type) return Boolean is List_Length : Natural; Index : Positive; Decide_Result : Filters.Decision_Type; use type Filters.Decision_Type; Filter : Filters.Filter_Class_Access; begin if not Is_Empty (Appender.Filters_List) then Index := First_Index (Appender.Filters_List); List_Length := Natural (Length (Appender.Filters_List)); for I in Index .. Index + List_Length - 1 loop Filter := Element (Appender.Filters_List, I); Decide_Result := Filters.Decide (Filter, Event); exit when Decide_Result = Filters.Accept_Event; if Decide_Result = Filters.Deny then return False; end if; end loop; end if; return True; end Continue; end Log4ada.Appenders; liblog4ada-1.2.orig/client/src/log4ada-appenders-xml.ads0000644000175000017500000000461611717262672023025 0ustar lbrentalbrenta------------------------------------------------------------------------------ -- Log4Ada -- -- -- -- Copyright (C) 2007 -- -- X. Grave CNRS -- -- -- -- This library is free software; you can redistribute it and/or modify -- -- it under the terms of the GNU General Public License as published by -- -- the Free Software Foundation; either version 2 of the License, or (at -- -- your option) any later version. -- -- -- -- This library is distributed in the hope that it will be useful, but -- -- WITHOUT ANY WARRANTY; without even the implied warranty of -- -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -- -- General Public License for more details. -- -- -- -- You should have received a copy of the GNU General Public License -- -- along with this library; if not, write to the Free Software Foundation, -- -- Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -- -- -- with Ada.Text_IO; with Log4ada.Loggers; generic type Output_Medium_Type is limited private; with function Output_Medium return Output_Medium_Type; with procedure Put (F : in Output_Medium_Type; S : in String) is <>; with procedure New_Line (F : in Output_Medium_Type; Spacing : in Ada.Text_IO.Positive_Count := 1) is <>; package Log4ada.Appenders.Xml is type Xml_Appender_Type is new Appender_Type with private; procedure Append (Xml_Appender : not null access Xml_Appender_Type; Event : Events.Event_Type); procedure Set_Logger (Xml_Appender : not null access Xml_Appender_Type; Logger : Loggers.Logger_Class_Access); private type Xml_Appender_Type is new Appender_Type with record Logger : Loggers.Logger_Class_Access := null; end record; end Log4ada.Appenders.Xml; liblog4ada-1.2.orig/client/src/log4ada-appenders-xml.adb0000644000175000017500000000762011717262672023002 0ustar lbrentalbrenta------------------------------------------------------------------------------ -- Log4Ada -- -- -- -- Copyright (C) 2007 -- -- X. Grave CNRS -- -- -- -- This library is free software; you can redistribute it and/or modify -- -- it under the terms of the GNU General Public License as published by -- -- the Free Software Foundation; either version 2 of the License, or (at -- -- your option) any later version. -- -- -- -- This library is distributed in the hope that it will be useful, but -- -- WITHOUT ANY WARRANTY; without even the implied warranty of -- -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -- -- General Public License for more details. -- -- -- -- You should have received a copy of the GNU General Public License -- -- along with this library; if not, write to the Free Software Foundation, -- -- Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -- -- -- with Ada.Command_Line; with GNAT.Sockets; with McKae.XML.EZ_Out.Generic_Medium; package body Log4ada.Appenders.Xml is package Output is new McKae.XML.EZ_Out.Generic_Medium (Output_Medium_Type, Put, New_Line); use Output; ------------ -- Append -- ------------ procedure Append (Xml_Appender : not null access Xml_Appender_Type; Event : Events.Event_Type) is Level : constant Level_Type := Events.Get_Level (Event); Time_Stamp_Milliseconds : constant String := Events.Get_Timestamp (Event)'Img & "000"; begin if not Xml_Appender.Enabled then return; end if; if not Continue (Xml_Appender, Event) then return; end if; Current_Format := McKae.XML.EZ_Out.Continuous_Stream; Start_Element (Output_Medium, "log4j:event", ("logger" = Events.Get_Logger_Name (Event), "timestamp" = Time_Stamp_Milliseconds (2 .. Time_Stamp_Milliseconds'Last), "level" = Level'Img, "thread" = Events.Get_Location_Information (Event))); if Events.Exception_Present (Event) then Output_Element (Output_Medium, "log4j:message", Events.Get_Message (Event) & "," & Events.Get_Exception_Name (Event) & "," & Events.Get_Exception_Message (Event)); else Output_Element (Output_Medium, "log4j:message", Events.Get_Message (Event)); end if; Start_Element (Output_Medium, "log4j:NDC"); Output_Element (Output_Medium, "host", GNAT.Sockets.Host_Name); Output_Element (Output_Medium, "prog_name", Ada.Command_Line.Command_Name); End_Element (Output_Medium, "log4j:NDC"); Start_Element (Output_Medium, "log4j:throwable"); End_Element (Output_Medium, "log4j:throwable"); End_Element (Output_Medium, "log4j:event"); end Append; procedure Set_Logger (Xml_Appender : not null access Xml_Appender_Type; Logger : Loggers.Logger_Class_Access) is begin Xml_Appender.Logger := Logger; end Set_Logger; end Log4ada.Appenders.Xml; liblog4ada-1.2.orig/client/src/log4ada-appenders-tcp_stream.ads0000644000175000017500000000413411717262672024361 0ustar lbrentalbrenta------------------------------------------------------------------------------ -- Log4Ada -- -- -- -- Copyright (C) 2007-2009 -- -- X. Grave CNRS -- -- -- -- This library is free software; you can redistribute it and/or modify -- -- it under the terms of the GNU General Public License as published by -- -- the Free Software Foundation; either version 2 of the License, or (at -- -- your option) any later version. -- -- -- -- This library is distributed in the hope that it will be useful, but -- -- WITHOUT ANY WARRANTY; without even the implied warranty of -- -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -- -- General Public License for more details. -- -- -- -- You should have received a copy of the GNU General Public License -- -- along with this library; if not, write to the Free Software Foundation, -- -- Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -- -- -- with GNAT.Sockets; package Log4ada.Appenders.Tcp_Stream is type Tcp_Stream_Type is limited new Appender_Type with private; procedure Append (Tcp_Stream : not null access Tcp_Stream_Type; Event : Events.Event_Type); procedure Set_Socket (Tcp_Stream : in out Tcp_Stream_Type; Socket : GNAT.Sockets.Socket_Type); private type Tcp_Stream_Type is new Appender_Type with record Socket_Open : Boolean := False; Socket : GNAT.Sockets.Socket_Type; end record; end Log4ada.Appenders.Tcp_Stream; liblog4ada-1.2.orig/client/src/log4ada-appenders-tcp_stream.adb0000644000175000017500000000443711717262672024346 0ustar lbrentalbrenta------------------------------------------------------------------------------ -- Log4Ada -- -- -- -- Copyright (C) 2007-2009 -- -- X. Grave CNRS -- -- -- -- This library is free software; you can redistribute it and/or modify -- -- it under the terms of the GNU General Public License as published by -- -- the Free Software Foundation; either version 2 of the License, or (at -- -- your option) any later version. -- -- -- -- This library is distributed in the hope that it will be useful, but -- -- WITHOUT ANY WARRANTY; without even the implied warranty of -- -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -- -- General Public License for more details. -- -- -- -- You should have received a copy of the GNU General Public License -- -- along with this library; if not, write to the Free Software Foundation, -- -- Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -- -- -- package body Log4ada.Appenders.Tcp_Stream is ------------ -- Append -- ------------ procedure Append (Tcp_Stream : not null access Tcp_Stream_Type; Event : Events.Event_Type) is Channel : GNAT.Sockets.Stream_Access := GNAT.Sockets.Stream (Tcp_Stream.Socket); begin if not Tcp_Stream.Socket_Open then return; end if; Events.Event_Type'Output (Channel, Event); GNAT.Sockets.Free (Channel); end Append; procedure Set_Socket (Tcp_Stream : in out Tcp_Stream_Type; Socket : GNAT.Sockets.Socket_Type) is begin Tcp_Stream.Socket := Set_Socket.Socket; Tcp_Stream.Socket_Open := True; end Set_Socket; end Log4ada.Appenders.Tcp_Stream; liblog4ada-1.2.orig/client/src/log4ada-appenders-files.ads0000644000175000017500000000521611717262672023324 0ustar lbrentalbrenta------------------------------------------------------------------------------ -- Log4Ada -- -- -- -- Copyright (C) 2007-2009 -- -- X. Grave CNRS -- -- -- -- This library is free software; you can redistribute it and/or modify -- -- it under the terms of the GNU General Public License as published by -- -- the Free Software Foundation; either version 2 of the License, or (at -- -- your option) any later version. -- -- -- -- This library is distributed in the hope that it will be useful, but -- -- WITHOUT ANY WARRANTY; without even the implied warranty of -- -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -- -- General Public License for more details. -- -- -- -- You should have received a copy of the GNU General Public License -- -- along with this library; if not, write to the Free Software Foundation, -- -- Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -- -- -- with Ada.Strings.Unbounded; with Ada.Text_IO; with Interfaces; package Log4ada.Appenders.Files is type File_Type is new Appender_Type with private; procedure Open (File : not null access File_Type; Name : String); procedure Refresh (File : not null access File_Type); procedure Close (File : not null access File_Type); procedure Append (File : not null access File_Type; Event : Events.Event_Type); procedure Set_File_Name (File : not null access File_Type; Name : String) renames Open; type File_Size_Type is new Interfaces.Unsigned_64; procedure Set_File_Max_Size (File : not null access File_Type; Size : File_Size_Type); private type File_Type is new Appender_Type with record File_Open : Boolean := False; Current_Number : Natural := 0; File_Name : Ada.Strings.Unbounded.Unbounded_String; File : Ada.Text_IO.File_Type; Max_Size : File_Size_Type := File_Size_Type'Last; Current_Size : File_Size_Type := 0; end record; end Log4ada.Appenders.Files; liblog4ada-1.2.orig/client/src/log4ada-appenders-files.adb0000644000175000017500000001252211717262672023301 0ustar lbrentalbrenta------------------------------------------------------------------------------ -- Log4Ada -- -- -- -- Copyright (C) 2007-2009 -- -- X. Grave CNRS -- -- -- -- This library is free software; you can redistribute it and/or modify -- -- it under the terms of the GNU General Public License as published by -- -- the Free Software Foundation; either version 2 of the License, or (at -- -- your option) any later version. -- -- -- -- This library is distributed in the hope that it will be useful, but -- -- WITHOUT ANY WARRANTY; without even the implied warranty of -- -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -- -- General Public License for more details. -- -- -- -- You should have received a copy of the GNU General Public License -- -- along with this library; if not, write to the Free Software Foundation, -- -- Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -- -- -- package body Log4ada.Appenders.Files is ---------- -- Open -- ---------- procedure Open (File : not null access File_Type; Name : String) is begin if File.File_Open then return; end if; File.File_Name := Ada.Strings.Unbounded.To_Unbounded_String (Name); Ada.Text_IO.Create (File.File, Name => Name & ".0"); File.File_Open := True; end Open; ------------- -- Refresh -- ------------- procedure Refresh (File : not null access File_Type) is begin if not File.File_Open then return; end if; File.Current_Number := File.Current_Number + 1; Close (File); File.File_Open := False; declare Number_Image : constant String := Natural'Image (File.Current_Number); begin Ada.Text_IO.Create (File.File, Name => Ada.Strings.Unbounded.To_String (File.File_Name) & "." & Number_Image (Number_Image'First + 1 .. Number_Image'Last)); end; File.Current_Size := 0; File.File_Open := True; end Refresh; ----------- -- Close -- ----------- procedure Close (File : not null access File_Type) is begin if File.File_Open then Ada.Text_IO.Close (File.File); File.File_Open := False; end if; end Close; ------------ -- Append -- ------------ function Event_Size (Event : Events.Event_Type) return File_Size_Type; procedure Append (File : not null access File_Type; Event : Events.Event_Type) is Timestamp_Diff : Integer; use Events; begin if not File.Enabled then return; end if; if not Continue (File, Event) then return; end if; if not File.File_Open then return; end if; if File.Current_Size + Event_Size (Event) > File.Max_Size then Refresh (File); end if; Timestamp_Diff := Get_Timestamp (Event) - Events.First_Event_Timestamp; Ada.Text_IO.Put (File.File, Timestamp_Diff'Img & " "); Ada.Text_IO.Put (File.File, Get_Level (Event)'Img & " ["); Ada.Text_IO.Put (File.File, Get_Location_Information (Event) & "] "); Ada.Text_IO.Put (File.File, Get_Logger_Name (Event) & " - "); Ada.Text_IO.Put (File.File, Get_Message (Event)); if Exception_Present (Event) then Ada.Text_IO.Put (File.File, " - " & Get_Exception_Name (Event)); Ada.Text_IO.Put_Line (File.File, " - " & Get_Exception_Message (Event)); else Ada.Text_IO.New_Line (File.File); end if; File.Current_Size := File.Current_Size + Event_Size (Event); Ada.Text_IO.Flush (File.File); end Append; function Event_Size (Event : Events.Event_Type) return File_Size_Type is Event_Size : File_Size_Type := 0; Timestamp_Diff : Integer; use Events; begin Timestamp_Diff := Get_Timestamp (Event) - Events.First_Event_Timestamp; Event_Size := Timestamp_Diff'Img'Length + 1; Event_Size := Event_Size + Get_Level (Event)'Img'Length + 2; Event_Size := Event_Size + Get_Location_Information (Event)'Length + 2; Event_Size := Event_Size + Get_Logger_Name (Event)'Length + 3; Event_Size := Event_Size + Get_Message (Event)'Length; if Exception_Present (Event) then Event_Size := Event_Size + Get_Exception_Name (Event)'Length + 3; Event_Size := Event_Size + Get_Exception_Message (Event)'Length + 4; else Event_Size := Event_Size + 1; end if; return Event_Size; end Event_Size; procedure Set_File_Max_Size (File : not null access File_Type; Size : File_Size_Type) is begin File.Max_Size := Size; end Set_File_Max_Size; end Log4ada.Appenders.Files; liblog4ada-1.2.orig/client/src/log4ada-appenders-consoles.ads0000644000175000017500000000402611717262672024045 0ustar lbrentalbrenta------------------------------------------------------------------------------ -- Log4Ada -- -- -- -- Copyright (C) 2007-2011 -- -- X. Grave CNRS -- -- -- -- This library is free software; you can redistribute it and/or modify -- -- it under the terms of the GNU General Public License as published by -- -- the Free Software Foundation; either version 2 of the License, or (at -- -- your option) any later version. -- -- -- -- This library is distributed in the hope that it will be useful, but -- -- WITHOUT ANY WARRANTY; without even the implied warranty of -- -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -- -- General Public License for more details. -- -- -- -- You should have received a copy of the GNU General Public License -- -- along with this library; if not, write to the Free Software Foundation, -- -- Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -- -- -- package Log4ada.Appenders.Consoles is type Console_Type is new Appender_Type with private; procedure Append (Console : not null access Console_Type; Event : Events.Event_Type); procedure Enable_Color (Console : not null access Console_Type); procedure Disable_Color (Console : not null access Console_Type); private type Console_Type is new Appender_Type with record Display_Color : Boolean := False; end record; end Log4ada.Appenders.Consoles; liblog4ada-1.2.orig/client/src/log4ada-appenders-consoles.adb0000644000175000017500000000741511717262672024031 0ustar lbrentalbrenta------------------------------------------------------------------------------ -- Log4Ada -- -- -- -- Copyright (C) 2007-2011 -- -- X. Grave CNRS -- -- -- -- This library is free software; you can redistribute it and/or modify -- -- it under the terms of the GNU General Public License as published by -- -- the Free Software Foundation; either version 2 of the License, or (at -- -- your option) any later version. -- -- -- -- This library is distributed in the hope that it will be useful, but -- -- WITHOUT ANY WARRANTY; without even the implied warranty of -- -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -- -- General Public License for more details. -- -- -- -- You should have received a copy of the GNU General Public License -- -- along with this library; if not, write to the Free Software Foundation, -- -- Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -- -- -- with Ada.Text_IO; package body Log4ada.Appenders.Consoles is procedure Change_Display_Mode (Level : Level_Type := Debug); procedure Raz_Display_Mode; procedure Change_Display_Mode (Level : Level_Type := Debug) is begin case Level is when All_Level | Off => null; when Debug => Ada.Text_IO.Put (ASCII.ESC & "[1;32m"); when Info => Ada.Text_IO.Put (ASCII.ESC & "[1;34m"); when Warn => Ada.Text_IO.Put (ASCII.ESC & "[1;33m"); when Error => Ada.Text_IO.Put (ASCII.ESC & "[1;31m"); when Fatal => Ada.Text_IO.Put (ASCII.ESC & "[5;1;31m"); end case; end Change_Display_Mode; procedure Raz_Display_Mode is begin Ada.Text_IO.Put (ASCII.ESC & "[0;m"); end Raz_Display_Mode; ------------ -- Append -- ------------ procedure Append (Console : not null access Console_Type; Event : Events.Event_Type) is Timestamp_Diff : Integer; use Events; begin if not Console.Enabled then return; end if; if not Continue (Console, Event) then return; end if; Timestamp_Diff := Get_Timestamp (Event) - Events.First_Event_Timestamp; if Console.Display_Color then Change_Display_Mode (Get_Level (Event)); end if; Ada.Text_IO.Put (Timestamp_Diff'Img & " "); Ada.Text_IO.Put (Get_Level (Event)'Img & " ["); Ada.Text_IO.Put (Get_Location_Information (Event) & "] "); Ada.Text_IO.Put (Get_Logger_Name (Event) & " - "); Ada.Text_IO.Put (Get_Message (Event)); if Exception_Present (Event) then Ada.Text_IO.Put (" - " & Get_Exception_Name (Event)); Ada.Text_IO.Put_Line (" - " & Get_Exception_Message (Event)); else Ada.Text_IO.New_Line; end if; if Console.Display_Color then Raz_Display_Mode; end if; end Append; procedure Enable_Color (Console : not null access Console_Type) is begin Console.Display_Color := True; end Enable_Color; procedure Disable_Color (Console : not null access Console_Type) is begin Console.Display_Color := False; end Disable_Color; end Log4ada.Appenders.Consoles; liblog4ada-1.2.orig/client/log4Ada.gpr0000644000175000017500000000145711717262672017442 0ustar lbrentalbrentawith "xmlezout.gpr"; project log4Ada is type arch is ("ppc","ppc64","i686","x86_64"); binaries : arch := external ("ARCH","ppc64"); for Source_Dirs use ("src", "../utilities/src/"); case binaries is when "ppc" => for Object_Dir use "obj/ppc"; for Exec_Dir use "bin/ppc"; when "ppc64" => for Object_Dir use "obj/ppc64"; for Exec_Dir use "bin/ppc64"; when "i686" => for Object_Dir use "obj/i686"; for Exec_Dir use "bin/i686"; when "x86_64" => for Object_Dir use "obj/x86_64"; for Exec_Dir use "bin/x86_64"; end case; for Library_Name use "log4Ada"; package Compiler is for Default_Switches ("ada") use ("-g", "-gnat05", "-gnatwa", "-gnaty", "-gnatf", "-gnato", "-gnatwe"); end Compiler; end log4Ada; liblog4ada-1.2.orig/client/demos/0000755000175000017500000000000011717262672016555 5ustar lbrentalbrentaliblog4ada-1.2.orig/client/demos/test_tcp_stream_appender.adb0000644000175000017500000000433011717262672024303 0ustar lbrentalbrenta------------------------------------------------------------------------------ -- Log4Ada -- -- -- -- Copyright (C) 2007-2009 -- -- X. Grave CNRS -- -- -- -- This library is free software; you can redistribute it and/or modify -- -- it under the terms of the GNU General Public License as published by -- -- the Free Software Foundation; either version 2 of the License, or (at -- -- your option) any later version. -- -- -- -- This library is distributed in the hope that it will be useful, but -- -- WITHOUT ANY WARRANTY; without even the implied warranty of -- -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -- -- General Public License for more details. -- -- -- -- You should have received a copy of the GNU General Public License -- -- along with this library; if not, write to the Free Software Foundation, -- -- Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -- -- -- with Appenders; with Log4ada.Loggers; with Log4ada.Socket_Utilities; with Log4ada.Appenders.Tcp_Stream; with Options; with Common_Output; procedure Test_Tcp_Stream_Appender is use Log4ada.Loggers; use Appenders; begin Set_Name (Logger'Access, "joli logger"); Set_Level (Logger'Access, Log4ada.Debug); Log4ada.Socket_Utilities.Open_Server_Link ("localhost", 3334); Log4ada.Appenders.Tcp_Stream.Set_Socket (Stream, Log4ada.Socket_Utilities.Get_Link); Add_Appender (Logger'Access, Stream'Access); Common_Output (Logger'Access, not Options.Present_Option ("loop")); end Test_Tcp_Stream_Appender; liblog4ada-1.2.orig/client/demos/test_socketappender.adb0000644000175000017500000000416111717262672023275 0ustar lbrentalbrenta------------------------------------------------------------------------------ -- Log4Ada -- -- -- -- Copyright (C) 2007 -- -- X. Grave CNRS -- -- -- -- This library is free software; you can redistribute it and/or modify -- -- it under the terms of the GNU General Public License as published by -- -- the Free Software Foundation; either version 2 of the License, or (at -- -- your option) any later version. -- -- -- -- This library is distributed in the hope that it will be useful, but -- -- WITHOUT ANY WARRANTY; without even the implied warranty of -- -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -- -- General Public License for more details. -- -- -- -- You should have received a copy of the GNU General Public License -- -- along with this library; if not, write to the Free Software Foundation, -- -- Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -- -- -- with Appenders; with Log4ada.Loggers; with Log4ada.Socket_Utilities; with Options; with Common_Output; procedure Test_Socketappender is use Log4ada.Loggers; use Appenders; begin Set_Name (Logger'Access, "joli logger"); Set_Level (Logger'Access, Log4ada.Debug); Appenders_Xml_Socket.Set_Logger (Xml_Socket'Access, Logger'Access); Log4ada.Socket_Utilities.Open_Server_Link ("localhost", 3334); Add_Appender (Logger'Access, Xml_Socket'Access); Common_Output (Logger'Access, not Options.Present_Option ("loop")); end Test_Socketappender; liblog4ada-1.2.orig/client/demos/test_file.adb0000644000175000017500000000461711717262672021213 0ustar lbrentalbrenta------------------------------------------------------------------------------ -- Log4Ada -- -- -- -- Copyright (C) 2007 -- -- X. Grave CNRS -- -- -- -- This library is free software; you can redistribute it and/or modify -- -- it under the terms of the GNU General Public License as published by -- -- the Free Software Foundation; either version 2 of the License, or (at -- -- your option) any later version. -- -- -- -- This library is distributed in the hope that it will be useful, but -- -- WITHOUT ANY WARRANTY; without even the implied warranty of -- -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -- -- General Public License for more details. -- -- -- -- You should have received a copy of the GNU General Public License -- -- along with this library; if not, write to the Free Software Foundation, -- -- Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -- -- -- with Log4ada.Loggers; with Log4ada.Appenders.Files; with Appenders; with Common_Output; with Options; procedure Test_File is use Log4ada.Loggers; use Appenders; function Get_Size is new Options.Get_Modular_Number (Log4ada.Appenders.Files.File_Size_Type); begin Set_Name (Logger'Access, "joli logger"); Set_Level (Logger'Access, Log4ada.Debug); if Options.Present_Option ("file_name") then File.Set_File_Name (Options.Get_Option ("file_name")); else File.Set_File_Name ("default_file_name.txt"); end if; if Options.Present_Option ("file_max_size") then File.Set_File_Max_Size (Get_Size ("file_max_size")); else File.Set_File_Max_Size (16384); end if; Add_Appender (Logger'Access, File'Access); Common_Output (Logger'Access, not Options.Present_Option ("loop")); end Test_File; liblog4ada-1.2.orig/client/demos/test_console.adb0000644000175000017500000000422411717262672021730 0ustar lbrentalbrenta------------------------------------------------------------------------------ -- Log4Ada -- -- -- -- Copyright (C) 2007 -- -- X. Grave CNRS -- -- -- -- This library is free software; you can redistribute it and/or modify -- -- it under the terms of the GNU General Public License as published by -- -- the Free Software Foundation; either version 2 of the License, or (at -- -- your option) any later version. -- -- -- -- This library is distributed in the hope that it will be useful, but -- -- WITHOUT ANY WARRANTY; without even the implied warranty of -- -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -- -- General Public License for more details. -- -- -- -- You should have received a copy of the GNU General Public License -- -- along with this library; if not, write to the Free Software Foundation, -- -- Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -- -- -- with Log4ada.Loggers; with Log4ada.Appenders.Consoles; with Appenders; with Common_Output; with Options; procedure Test_Console is use Log4ada.Loggers; use Appenders; begin Set_Name (Logger'Access, "joli logger"); Set_Level (Logger'Access, Log4ada.Debug); Add_Appender (Logger'Access, Console'Access); Log4ada.Appenders.Consoles.Enable_Color (Console'Access); Appenders_Xml_Text_Io.Set_Logger (Xml_Console'Access, Logger'Access); Add_Appender (Logger'Access, Xml_Console'Access); Common_Output (Logger'Access, not Options.Present_Option ("loop")); end Test_Console; liblog4ada-1.2.orig/client/demos/tcp_receiver.ads0000644000175000017500000000452711717262672021730 0ustar lbrentalbrenta------------------------------------------------------------------------------ -- Log4Ada -- -- -- -- Copyright (C) 2007-2009 -- -- X. Grave CNRS -- -- -- -- This library is free software; you can redistribute it and/or modify -- -- it under the terms of the GNU General Public License as published by -- -- the Free Software Foundation; either version 2 of the License, or (at -- -- your option) any later version. -- -- -- -- This library is distributed in the hope that it will be useful, but -- -- WITHOUT ANY WARRANTY; without even the implied warranty of -- -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -- -- General Public License for more details. -- -- -- -- You should have received a copy of the GNU General Public License -- -- along with this library; if not, write to the Free Software Foundation, -- -- Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -- -- with GNAT.Sockets; with Log4ada.Appenders.Consoles; with Log4ada.Appenders.Files; with Log4ada.Loggers; with Log4ada.Events; package Tcp_Receiver is procedure Start (Port : GNAT.Sockets.Port_Type; Name : String); procedure Stop; protected Logger_Shell is procedure Setup (Name : String); procedure Start_File_Recording (File_Name : String); procedure File_Name_Refresh; procedure Stop_File_Recording; procedure Start_Output; procedure Stop_Output; procedure Put_Message (Event : Log4ada.Events.Event_Type); private Setup_Done : Boolean := False; File_Recording_On : Boolean := False; Logger : aliased Log4ada.Loggers.Logger_Type; Console : aliased Log4ada.Appenders.Consoles.Console_Type; File : aliased Log4ada.Appenders.Files.File_Type; end Logger_Shell; end Tcp_Receiver; liblog4ada-1.2.orig/client/demos/tcp_receiver.adb0000644000175000017500000001464111717262672021705 0ustar lbrentalbrenta------------------------------------------------------------------------------ -- Log4Ada -- -- -- -- Copyright (C) 2007-2009 -- -- X. Grave CNRS -- -- -- -- This library is free software; you can redistribute it and/or modify -- -- it under the terms of the GNU General Public License as published by -- -- the Free Software Foundation; either version 2 of the License, or (at -- -- your option) any later version. -- -- -- -- This library is distributed in the hope that it will be useful, but -- -- WITHOUT ANY WARRANTY; without even the implied warranty of -- -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -- -- General Public License for more details. -- -- -- -- You should have received a copy of the GNU General Public License -- -- along with this library; if not, write to the Free Software Foundation, -- -- Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -- -- with Ada.Unchecked_Deallocation; with Ada.Text_IO; package body Tcp_Receiver is use Log4ada.Appenders.Consoles; use Log4ada.Appenders.Files; type Receiver_Task; type Receiver_Access is access Receiver_Task; task type Receiver_Task is entry Start (Socket : GNAT.Sockets.Socket_Type; Self : Receiver_Access); end Receiver_Task; procedure Free is new Ada.Unchecked_Deallocation (Receiver_Task, Receiver_Access); task Tcp_Server is entry Start (Port : GNAT.Sockets.Port_Type); entry Stop; end Tcp_Server; ----------- -- Start -- ----------- procedure Start (Port : GNAT.Sockets.Port_Type; Name : String) is begin Logger_Shell.Setup (Name); Tcp_Server.Start (Port); end Start; ---------- -- Stop -- ---------- procedure Stop is begin Logger_Shell.Stop_File_Recording; Logger_Shell.Stop_Output; Tcp_Server.Stop; end Stop; protected body Logger_Shell is procedure Setup (Name : String) is use Log4ada.Loggers; begin Set_Name (Logger'Access, Name); Set_Level (Logger'Access, Log4ada.All_Level); Add_Appender (Logger'Access, Console'Access); Add_Appender (Logger'Access, File'Access); Disable (Console'Access); Disable (File'Access); Setup_Done := True; end Setup; procedure Start_File_Recording (File_Name : String) is begin if File_Recording_On then return; end if; Open (File'Access, File_Name); Enable (File'Access); File_Recording_On := True; end Start_File_Recording; procedure File_Name_Refresh is begin if not File_Recording_On then return; end if; Refresh (File'Access); end File_Name_Refresh; procedure Stop_File_Recording is begin if not File_Recording_On then return; end if; Disable (File'Access); Close (File'Access); File_Recording_On := False; end Stop_File_Recording; procedure Start_Output is begin Enable (Console'Access); end Start_Output; procedure Stop_Output is begin Disable (Console'Access); end Stop_Output; procedure Put_Message (Event : Log4ada.Events.Event_Type) is begin Log4ada.Loggers.Event_Out (Logger'Access, Event); end Put_Message; end Logger_Shell; task body Receiver_Task is use GNAT.Sockets; Socket : Socket_Type; Self : Receiver_Access; begin select accept Start (Socket : GNAT.Sockets.Socket_Type; Self : Receiver_Access) do Receiver_Task.Socket := Start.Socket; Receiver_Task.Self := Start.Self; end Start; or terminate; end select; loop declare Channel : GNAT.Sockets.Stream_Access := null; Event : Log4ada.Events.Event_Type; begin Channel := GNAT.Sockets.Stream (Socket); Event := Log4ada.Events.Event_Type'Input (Channel); Logger_Shell.Put_Message (Event); GNAT.Sockets.Free (Channel); exception when others => if Channel /= null then GNAT.Sockets.Free (Channel); end if; Close_Socket (Socket); Ada.Text_IO.Put_Line ("tcp receiver connection socket closed"); exit; end; end loop; Free (Self); end Receiver_Task; task body Tcp_Server is use Gnat.Sockets; Network_Address : Sock_Addr_Type; Server : Socket_Type; Socket : Socket_Type; Request : Request_Type := (Non_Blocking_IO, True); New_Task : Receiver_Access; begin select accept Start (Port : GNAT.Sockets.Port_Type) do Network_Address.Addr := Addresses (Get_Host_By_Name ("localhost"), 1); Network_Address.Port := Port; Create_Socket (Server); Set_Socket_Option (Server, Socket_Level, (Reuse_Address, True)); Bind_Socket (Server, Network_Address); Listen_Socket (Server); Control_Socket (Server, Request); end Start; or terminate; end select; loop begin Accept_Socket (Server, Socket, Network_Address); New_Task := new Receiver_Task; New_Task.Start (Socket, New_Task); exception when Gnat.Sockets.Socket_Error => select accept Stop; exit; or delay 0.1; end select; end; end loop; Close_Socket (Server); end Tcp_Server; end Tcp_Receiver; liblog4ada-1.2.orig/client/demos/common_output.ads0000644000175000017500000000024111717262672022153 0ustar lbrentalbrentawith Log4ada.Loggers; procedure Common_Output (Logger : not null access Log4ada.Loggers.Logger_Type; Exit_Loop_Log : Boolean := True); liblog4ada-1.2.orig/client/demos/common_output.adb0000644000175000017500000000142711717262672022141 0ustar lbrentalbrentaprocedure Common_Output (Logger : not null access Log4ada.Loggers.Logger_Type; Exit_Loop_Log : Boolean := True) is use Log4ada.Loggers; begin loop Info_Out (Logger, "start demo"); Debug_Out (Logger, "Here is some DEBUG"); Set_Level (Logger, Log4ada.Warn); Info_Out (Logger, "Here is some INFO"); Warn_Out (Logger, "Here is some WARN"); Error_Out (Logger, "Here is some ERROR"); delay 2.0; Fatal_Out (Logger, "Here is some FATAL"); delay 1.0; declare Local_Exception : exception; begin raise Local_Exception; exception when E : others => Fatal_Out (Logger, "Here is some FATAL in exception", E); end; exit when Exit_Loop_Log; end loop; end Common_Output; liblog4ada-1.2.orig/client/demos/central_log_tcp.adb0000644000175000017500000000602611717262672022370 0ustar lbrentalbrenta------------------------------------------------------------------------------ -- Log4Ada -- -- -- -- Copyright (C) 2007-2009 -- -- X. Grave CNRS -- -- -- -- This library is free software; you can redistribute it and/or modify -- -- it under the terms of the GNU General Public License as published by -- -- the Free Software Foundation; either version 2 of the License, or (at -- -- your option) any later version. -- -- -- -- This library is distributed in the hope that it will be useful, but -- -- WITHOUT ANY WARRANTY; without even the implied warranty of -- -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -- -- General Public License for more details. -- -- -- -- You should have received a copy of the GNU General Public License -- -- along with this library; if not, write to the Free Software Foundation, -- -- Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -- -- with Ada.Exceptions; with Tcp_Receiver; with Options; with GNAT.Sockets; with Ada.Text_IO; procedure Central_Log_Tcp is Port : GNAT.Sockets.Port_Type; function Get_Port is new Options.Get_Integer_Number (GNAT.Sockets.Port_Type); begin if Options.Present_Option ("port") then Port := Get_Port ("port"); else Port := 3334; end if; if Options.Present_Option ("name") then declare Name : constant String := Options.Get_Option ("name"); begin Tcp_Receiver.Start (Port => Port, Name => Name); end; else Tcp_Receiver.Start (Port => Port, Name => "central_log_tcp"); end if; declare Key : Character; begin loop Ada.Text_IO.Get_Immediate (Key); exit when Key = 'q' or Key = 'Q'; case Key is when 'f' | 'F' => Tcp_Receiver.Logger_Shell.Start_File_Recording ("test"); when 'r' | 'R' => Tcp_Receiver.Logger_Shell.File_Name_Refresh; when 'c' | 'C' => Tcp_Receiver.Logger_Shell.Start_Output; when others => Ada.Text_IO.Put_Line (Key & ": unknown command"); end case; end loop; end; Tcp_Receiver.Stop; exception when E : others => Ada.Text_IO.Put_Line ("unexpected exception named : " & Ada.Exceptions.Exception_Name (E)); Ada.Text_IO.Put_Line ("with message : " & Ada.Exceptions.Exception_Message (E)); end Central_Log_Tcp; liblog4ada-1.2.orig/client/demos/appenders.ads0000644000175000017500000000503511717262672021232 0ustar lbrentalbrenta------------------------------------------------------------------------------ -- Log4Ada -- -- -- -- Copyright (C) 2007 -- -- X. Grave CNRS -- -- -- -- This library is free software; you can redistribute it and/or modify -- -- it under the terms of the GNU General Public License as published by -- -- the Free Software Foundation; either version 2 of the License, or (at -- -- your option) any later version. -- -- -- -- This library is distributed in the hope that it will be useful, but -- -- WITHOUT ANY WARRANTY; without even the implied warranty of -- -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -- -- General Public License for more details. -- -- -- -- You should have received a copy of the GNU General Public License -- -- along with this library; if not, write to the Free Software Foundation, -- -- Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -- -- -- with Ada.Text_IO; with GNAT.Sockets; with Log4ada.Appenders.Consoles; with Log4ada.Appenders.Files; with Log4ada.Appenders.Tcp_Stream; with Log4ada.Appenders.Xml; with Log4ada.Loggers; with Log4ada.Socket_Utilities; package Appenders is Logger : aliased Log4ada.Loggers.Logger_Type; Console : aliased Log4ada.Appenders.Consoles.Console_Type; File : aliased Log4ada.Appenders.Files.File_Type; Stream : aliased Log4ada.Appenders.Tcp_Stream.Tcp_Stream_Type; package Appenders_Xml_Text_Io is new Log4ada.Appenders.Xml (Ada.Text_IO.File_Type, Ada.Text_IO.Standard_Output, Ada.Text_IO.Put, Ada.Text_IO.New_Line); Xml_Console : aliased Appenders_Xml_Text_Io.Xml_Appender_Type; package Appenders_Xml_Socket is new Log4ada.Appenders.Xml (GNAT.Sockets.Socket_Type, Log4ada.Socket_Utilities.Get_Link, Log4ada.Socket_Utilities.Put, Log4ada.Socket_Utilities.New_Line); Xml_Socket : aliased Appenders_Xml_Socket.Xml_Appender_Type; end Appenders; liblog4ada-1.2.orig/client/GNUmakefile0000644000175000017500000000060011717262672017514 0ustar lbrentalbrentaARCH=$(shell uname -m) all:libs tests libs:obj/$(ARCH) bin/$(ARCH) gnatmake -P log4Ada -XARCH=$(ARCH) tests:libs gnatmake -P tests -XARCH=$(ARCH) clean: rm -f `find . -name "*~"` rm -f `find . -name "*.o"` rm -f `find . -name "*.ali"` rm -f default_file_name.txt.* distclean:clean rm -Rf bin obj dirs obj/$(ARCH): mkdir -p obj/$(ARCH) bin/$(ARCH): mkdir -p bin/$(ARCH) liblog4ada-1.2.orig/build_log4ada_lib.gpr0000644000175000017500000000166211717262672020227 0ustar lbrentalbrentawith "xmlezout"; project build_log4ada_lib is for Library_Name use "log4ada"; for Library_Kind use External ("LIBRARY_KIND"); for Library_Dir use "."; for Library_ALI_Dir use External ("OBJ_DIR") & "/ali"; for Library_Version use External ("SONAME"); for Object_Dir use External ("OBJ_DIR"); for Source_Dirs use ("client/src"); package Compiler is for Default_Switches ("Ada") use ("-gnat05", -- Ada 2005 mode "-gnati1", -- Full ISO 8859-1 character set allowed in -- source code (for generated CORBA stubs) "-gnatf", -- Full compiler error messages "-gnaty", -- Enable style checks "-gnatwa", -- Enable all warnings "-gnatwe"); -- Warning as errors end Compiler; package Binder is for Default_Switches ("Ada") use ("-E"); end Binder; end build_log4ada_lib; liblog4ada-1.2.orig/README0000644000175000017500000000052211717262672015047 0ustar lbrentalbrentaThis directory contains log4Ada, a library intended to ease logging in applications written in Ada. For more information about the logging scheme developped in this library see the log4j project : http://logging.apache.org/log4j/docs/ This library is free software. See the COPYING file for the details of the GNU General Public License. liblog4ada-1.2.orig/GNUmakefile0000644000175000017500000000337311717262672016250 0ustar lbrentalbrentaCPUS := $(shell getconf _NPROCESSORS_ONLN) INSTALL := $(HOME) ADA_PROJECT_PATH := $(dir $(shell which gnatls))../include FILES=$(wildcard client/src/*.ad[sb]) ALI_BASE=log4ada-events.ali log4ada.ali log4ada-filters.ali \ log4ada-appenders.ali log4ada-loggers.ali log4ada-appenders-consoles.ali \ log4ada-socket_utilities.ali log4ada-appenders-files.ali log4ada-types.ali \ log4ada-appenders-tcp_stream.ali options.ali log4ada-appenders-xml.ali ALI_FILES=$(addprefix obj-shared/,$(ALI_BASE)) ANNEX_E_FILES=$(wildcard server/src_annex_e/*.ad[sb]) DIRS=client server all: for i in $(DIRS);do ADA_PROJECT_PATH=$(ADA_PROJECT_PATH) make -C $$i; \ done clean: for i in $(DIRS);do make -C $$i clean;done rm -f *~ distclean: for i in $(DIRS);do make -C $$i distclean;done rm -f *~ rm -Rf obj-shared obj-static rm -f liblog4ada.a liblog4ada.so .PHONY:shared_library static_library install:shared_library static_library mkdir -p $(INSTALL)/lib/log4ada mkdir -p $(INSTALL)/include/log4ada mkdir -p $(INSTALL)/include/log4ada/annex_e cp -f log4Ada.gpr $(INSTALL)/include/log4Ada.gpr cp -f log4Ada_annex_e.gpr $(INSTALL)/include/log4Ada_annex_e.gpr cp -f liblog4ada.a liblog4ada.so $(INSTALL)/lib/log4ada cd $(INSTALL)/lib;ln -s log4ada/liblog4ada.so;cd - cp -f $(ALI_FILES) $(INSTALL)/lib/log4ada chmod uog-w $(INSTALL)/lib/log4ada/*.ali cp -f $(FILES) $(INSTALL)/include/log4ada cp -f $(ANNEX_E_FILES) $(INSTALL)/include/log4ada/annex_e shared_library: ADA_PROJECT_PATH=$(ADA_PROJECT_PATH) \ gnatmake -p -j$(CPUS) -Pbuild_log4ada_lib.gpr \ -XLIBRARY_KIND=dynamic -XSONAME=liblog4ada.so -XOBJ_DIR=obj-shared static_library: ADA_PROJECT_PATH=$(ADA_PROJECT_PATH) \ gnatmake -p -j$(CPUS) -Pbuild_log4ada_lib.gpr \ -XLIBRARY_KIND=static -XOBJ_DIR=obj-static liblog4ada-1.2.orig/COPYING0000644000175000017500000004311011717262672015222 0ustar lbrentalbrenta GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Library General Public License instead of this License. liblog4ada-1.2.orig/AUTHOR0000644000175000017500000000010711717262672015113 0ustar lbrentalbrentaLog4ada is written by X. Grave (grave@ipno.in2p3.fr) on behalf of CNRS