Index

Package: Facilities

Description

package Alog.Facilities is
Alog facilities package. Provides common data and methods used by all facilities.

Packages

BS_Path (new Generic_Bounded_Length)

package BS_Path is new Generic_Bounded_Length (Max_Path_Length);

Classes

Instance (abstract)

type Instance is abstract tagged limited private;
Abstract type facility instance. All facilities in the Alog framework must implement this type.

Types

Class

subtype Class is Instance'Class;

Handle

type Handle is access all Class;

Subprograms & Entries

=

function "=" 
(Left: Handle;
Right: Handle) return Boolean;
Equal function.

Set_Name

procedure Set_Name 
(Facility: in out Class;
Name: String);
Set facility name.

Get_Name

function Get_Name 
(Facility: Class) return String;
Get facility name.

Get_Timestamp

function Get_Timestamp 
(Facility: Class;
Time: Ada.Calendar.Time := Ada.Calendar.Clock) return String;
Creates a timestamp and returns it as String. If no Time is given, the current time is used.

Process

procedure Process 
(Facility: Class;
Request: Log_Request.Instance);
Process a log request.

Write (abstract)

procedure Write 
(Facility: Instance;
Level: Log_Level := Info;
Msg: String) is abstract;
Write message with specified log level. This procedure must be implemented by all facilities.

Toggle_Write_Timestamp

procedure Toggle_Write_Timestamp 
(Facility: in out Class;
State: Boolean);
Enable/disable whether a timestamp is written for log messages.

Toggle_UTC_Timestamp

procedure Toggle_UTC_Timestamp 
(Facility: in out Class;
State: Boolean);
Enable/disable UTC timestamps for log messages.

Is_Write_Timestamp

function Is_Write_Timestamp 
(Facility: Class) return Boolean;
Returns the current value of Write_Timestamp.

Is_UTC_Timestamp

function Is_UTC_Timestamp 
(Facility: Class) return Boolean;
Returns True if the timestamp of the facility is written in UTC time.

Toggle_Write_Loglevel

procedure Toggle_Write_Loglevel 
(Facility: in out Class;
State: Boolean);
Enable/disable whether the loglevel is written for log messages.

Is_Write_Loglevel

function Is_Write_Loglevel 
(Facility: Class) return Boolean;
Returns the current value of Write_Loglevel.

Toggle_Write_Source

procedure Toggle_Write_Source 
(Facility: in out Class;
State: Boolean);
Enable/disable whether the source of the message is logged.

Is_Write_Source

function Is_Write_Source 
(Facility: Class) return Boolean;
Returns True if writing of log message sources is enabled.

Setup

procedure Setup 
(Facility: in out Instance) is null;
Each facility must provide a Setup-procedure. These procedures are called by Logger instances when attaching Facilities. All needed operations prior to writing log messages should be done here.

Teardown

procedure Teardown 
(Facility: in out Instance) is null;
Each facility must provide a Teardown-procedure. These procedures are called by Logger instances when detaching Facilities or when the logger object gets out of scope.