?? RIGHT := 110 ??
?? NEWTITLE := 'NOS/VE Logging' ??
MODULE pmm$interface_to_logging;
?? RIGHT := 110 ??

{   PURPOSE:
{     This module contains RING 3 procedures and data structures
{     necessary to support Logging.
{
{   DESIGN:
{     This module contains those procedures that are documented
{     in the PROGRAM ERS.

?? NEWTITLE := '  TYPE Declarations' ??
?? PUSH (LISTEXT := ON) ??
*copyc pmd$system_log_interface
*copyc pmd$log_entries
*copyc lgt$log_read_activity
*copyc lgt$entry_info
*copyc pme$logging_exceptions
*copyc lgk$log_ascii
*copyc pmt$program_parameters
*copyc ost$caller_identifier
?? POP ??

?? TITLE := '  XREF procedures', EJECT ??
*copy lgp$add_entry_to_ascii_log
*copy osp$set_status_abnormal
?? TITLE := '  pmp$log', EJECT ??
*copy pmh$log

  PROCEDURE [XDCL, #GATE] pmp$log
    (    text: pmt$log_msg_text;
     VAR status: ost$status);

    pmp$log_ascii (text, $pmt$ascii_logset [pmc$job_log], pmc$msg_origin_program, status);

  PROCEND pmp$log;

?? TITLE := '  PMP$LOG_ASCII', EJECT ??
*copy pmh$log_ascii

  PROCEDURE [INLINE, XDCL, #GATE] pmp$log_ascii
    (    text: pmt$log_msg_text;
         log: pmt$ascii_logset;
         origin: pmt$log_msg_origin;
     VAR status: ost$status);

    VAR
      local_text: ^pmt$log_msg_text,
      caller_id: ost$caller_identifier,
      local_log: pmt$ascii_logset;

    status.normal := TRUE;
    #CALLER_ID (caller_id);
    PUSH local_text: [STRLENGTH (text)];
    local_text^ := text;

    local_log := log;

    lgp$add_entry_to_ascii_log (local_log, origin, local_text^, status);

{
{ The following "commented out" code used to be used to assist the
{ DISPLAY_LOG and DISPLAY_SYSTEM_LOG commands to keep track of the
{ last entry placed in the corresponding log.  This function has
{ been moved to the appropriate modules.
{
{     clp$fetch_display_log_indices (indices);
{
{     IF pmc$system_log IN local_log THEN
{       indices [clc$display_system_log].last_log_entry := logset_entry_info [pmc$system_log].entry_offset;
{       IF logset_entry_info [pmc$system_log].log_cycle <> indices [clc$display_system_log].last_log_cycle
{             THEN
{         indices [clc$display_system_log].last_display_log_entry := 0;
{       IFEND;
{       indices [clc$display_system_log].last_log_cycle := logset_entry_info [pmc$system_log].log_cycle;
{     IFEND;
{
{     IF pmc$job_log IN local_log THEN
{       indices [clc$display_job_log].last_log_entry := logset_entry_info [pmc$job_log].entry_offset;
{       IF logset_entry_info [pmc$job_log].log_cycle <> indices [clc$display_job_log].last_log_cycle THEN
{         indices [clc$display_job_log].last_display_log_entry := 0;
{       IFEND;
{       indices [clc$display_job_log].last_log_cycle := logset_entry_info [pmc$job_log].log_cycle;
{     IFEND;
{
{     clp$store_display_log_indices (indices);
{


  PROCEND pmp$log_ascii;
MODEND pmm$interface_to_logging;
