Package: Facilities

## Documentation

Table of Contents
Class Inheritance Tree

## Index

Package: Facilities

- Goto spec source

# 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)

- Goto declaration in source
- Goto full declaration in source

    type Instance is abstract tagged limited private;

#### Immediate Children:

Alog.Facilities.Class
Alog.Facilities.File_Descriptor.Instance
Alog.Facilities.Pgsql.Instance
Alog.Facilities.SMTP.Instance
Alog.Facilities.Syslog.Instance
Alog.Facilities.XMPP.Instance

#### Primitive operations:

Setup

- To API doc
- To spec

Teardown

- To API doc
- To spec

Write

- To API doc
- To spec

Abstract type facility instance. All facilities in the Alog framework must implement this type.

# Types

### Class

- Goto declaration in source

    subtype Class is Instance'Class;

### Handle

- Goto declaration in source

    type Handle is access all Class;

# Subprograms & Entries

### =

- Goto spec in source

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

Equal function.

### Set_Name

- Goto spec in source

    procedure Set_Name (Facility: in out Class;Name:        String);

Set facility name.

### Get_Name

- Goto spec in source

    function Get_Name (Facility: Class) return String;

Get facility name.

### Get_Timestamp

- Goto spec in source

    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

- Goto spec in source

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

Process a log request.

### Write (abstract)

- Goto spec in source

    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

- Goto spec in source

    procedure Toggle_Write_Timestamp (Facility: in out Class;State:        Boolean);

Enable/disable whether a timestamp is written for log messages.

### Toggle_UTC_Timestamp

- Goto spec in source

    procedure Toggle_UTC_Timestamp (Facility: in out Class;State:        Boolean);

Enable/disable UTC timestamps for log messages.

### Is_Write_Timestamp

- Goto spec in source

    function Is_Write_Timestamp (Facility: Class) return Boolean;

Returns the current value of Write_Timestamp.

### Is_UTC_Timestamp

- Goto spec in source

    function Is_UTC_Timestamp (Facility: Class) return Boolean;

Returns True if the timestamp of the facility is written in UTC time.

### Toggle_Write_Loglevel

- Goto spec in source

    procedure Toggle_Write_Loglevel (Facility: in out Class;State:        Boolean);

Enable/disable whether the loglevel is written for log messages.

### Is_Write_Loglevel

- Goto spec in source

    function Is_Write_Loglevel (Facility: Class) return Boolean;

Returns the current value of Write_Loglevel.

### Toggle_Write_Source

- Goto spec in source

    procedure Toggle_Write_Source (Facility: in out Class;State:        Boolean);

Enable/disable whether the source of the message is logged.

### Is_Write_Source

- Goto spec in source

    function Is_Write_Source (Facility: Class) return Boolean;

Returns True if writing of log message sources is enabled.

### Setup

- Goto spec in source

    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

- Goto spec in source

    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.