Index

Package: Tasked_Logger

Description

package Alog.Tasked_Logger is
Tasked Logger instance. Facilities can be attached to this logger instance in order to log to different targets simultaneously. This instance provides task-safe concurrent logging.

Tasks & Protected

Instance (task type)

Tasked logger instance. The Init discriminant defines whether or not a default 'stdout' (FD facility without logfile set) is attached automatically. Default is 'False'. Set Init to 'True' if you want to make sure minimal stdout logging is possible as soon as a new logger is instantiated. By default exceptions which occur during asynchronous processing are printed to standard error. Use the Set_Except_Handler entry to register a custom exception handler.

Types

Facility_Update_Handle

type Facility_Update_Handle is not null access
     procedure (Facility_Handle : Facilities.Handle);
Handle to facility update procedure.

Handle

type Handle is access all Instance;
Handle to tasked logger type.

Subprograms & Entries

Instance. Init

Init: Boolean := False)

Instance. Attach_Facility (abstract)

entry Attach_Facility 
(Facility: Facilities.Handle);
Attach a facility to tasked logger instance.

Instance. Attach_Default_Facility (abstract)

entry Attach_Default_Facility;
Attach default facility to tasked logger instance.

Instance. Detach_Facility (abstract)

entry Detach_Facility 
(Name: String);
Detach a facility from tasked logger instance.

Instance. Detach_Default_Facility (abstract)

entry Detach_Default_Facility;
Detach default facility from tasked logger instance.

Instance. Facility_Count (abstract)

entry Facility_Count 
(Count: out Natural);
Return number of attached facilites.

Instance. Update (abstract)

entry Update 
(Name: String;
Process: Facility_Update_Handle);
Update a specific facility identified by 'Name'. Calls the 'Process' procedure to perform the update operation.

Instance. Iterate (abstract)

entry Iterate 
(Process: Facility_Update_Handle);
Call 'Process' for all attached facilities.

Instance. Attach_Transform (abstract)

entry Attach_Transform 
(Transform: Transforms.Handle);
Attach a transform to tasked logger instance.

Instance. Detach_Transform (abstract)

entry Detach_Transform 
(Name: String);
Detach a transform from tasked logger instance.

Instance. Transform_Count (abstract)

entry Transform_Count 
(Count: out Natural);
Return number of attached transforms.

Instance. Log_Message (abstract)

entry Log_Message 
(Source: String := "";
Level: Log_Level;
Msg: String;
Caller: Ada.Task_Identification.Task_Id := Ada.Task_Identification.Null_Task_Id);
Log a message. The Write_Message() procedure of all attached facilities is called. Depending on the Log-Threshold set, the message is logged to different targets (depending on the facilites) automatically. If an exception occurs, the exception handler procedure is called. If caller is not specified the executing task's ID is used instead. Since Log_Message'Caller can not be used as default parameter the entry checks if the variable is set to 'Null_Task_Id' in the body.

Instance. Clear (abstract)

entry Clear;
Clear tasked logger instance. Detach and teardown all attached facilities and transforms and clear any stored exceptions.

Instance. Shutdown (abstract)

entry Shutdown;
Explicitly shutdown tasked logger.

Instance. Set_Except_Handler (abstract)

entry Set_Except_Handler 
(Proc: Exceptions.Exception_Handler);
Set custom exception handler procedure.