Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
proview
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Esteban Blanc
proview
Commits
9fc052fe
Commit
9fc052fe
authored
May 13, 2003
by
claes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Moved to os_vms
parent
a32535f1
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
152 deletions
+0
-152
src/exe/rt_elog/src/mh_log.c
src/exe/rt_elog/src/mh_log.c
+0
-152
No files found.
src/exe/rt_elog/src/mh_log.c
deleted
100644 → 0
View file @
a32535f1
/* mh_log.c -- Log utilities
PROVIEW/R
Copyright (C) 1996 by Comator Process AB.
<Description>. */
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#ifdef OS_VMS
#include <starlet.h>
#include <signal.h>
#endif
#include "co_cdh.h"
#include "co_time.h"
#include "rt_mh_log.h"
FILE
*
mh_LogFileOpen
(
qcom_sQid
*
qid
)
{
char
LogFileName
[
48
];
FILE
*
fp
;
char
DECnetHost
[
20
]
=
""
;
#ifdef OS_ELN
ini_GetNodeInfo
(
NULL
,
NULL
,
NULL
,
DECnetHost
,
NULL
,
NULL
);
if
(
strlen
(
DECnetHost
)
>
0
)
strcat
(
DECnetHost
,
"::"
);
#endif
sprintf
(
LogFileName
,
"%spwrp_log:mh_%d_%d.log"
,
DECnetHost
,
qid
->
nid
,
qid
->
qix
);
fp
=
fopen
(
LogFileName
,
"w+"
,
"shr=get"
,
"ctx=rec"
);
if
(
fp
)
{
printf
(
"Opened logfile: %s
\n
"
,
LogFileName
);
fprintf
(
fp
,
"%8s %18s %19s %3s %10s %8s %8s %12s %4s %8s %10s
\n
"
,
"QId"
,
"Time"
,
"MsgType"
,
"Nix"
,
"EventIndex"
,
"Object"
,
"EventFlg"
,
"EventType"
,
"Prio"
,
"EventSts"
,
"Status"
);
fflush
(
fp
);
}
else
{
#ifdef OS_ELN
printf
(
"Can't open logfile %s, %d, %d
\n
"
,
LogFileName
,
errno
,
vaxc
$
errno
);
#else
printf
(
"Can't open logfile %s, %d
\n
"
,
LogFileName
,
errno
);
#endif
}
return
fp
;
}
void
mh_LogMessage
(
FILE
*
fp
,
pwr_tStatus
sts
,
mh_eMsg
Type
,
mh_sMsgInfo
*
Msg
,
qcom_sQid
*
QId
)
{
char
TimeStr
[
24
];
int
Event
;
struct
tm
*
TmpTm
;
pwr_tTime
TmpTime
;
int
nsec
;
static
char
*
EventText
[
mh_eEvent_
]
=
{
"NoEvent"
,
"Ack"
,
"Block"
,
"Cancel"
,
"CancelBlock"
,
"Missing"
,
"Reblock"
,
"Return"
,
"Unblock"
,
"***"
,
"***"
,
"***"
,
"***"
,
"***"
,
"***"
,
"***"
,
"***"
,
"***"
,
"***"
,
"***"
,
"***"
,
"***"
,
"***"
,
"***"
,
"***"
,
"***"
,
"***"
,
"***"
,
"***"
,
"***"
,
"***"
,
"***"
,
"Info"
,
"***"
,
"***"
,
"***"
,
"***"
,
"***"
,
"***"
,
"***"
,
"***"
,
"***"
,
"***"
,
"***"
,
"***"
,
"***"
,
"***"
,
"***"
,
"***"
,
"***"
,
"***"
,
"***"
,
"***"
,
"***"
,
"***"
,
"***"
,
"***"
,
"***"
,
"***"
,
"***"
,
"***"
,
"***"
,
"***"
,
"***"
,
"Alarm"
};
static
char
*
PrioText
[]
=
{
"D"
,
"C"
,
"B"
,
"A"
};
static
char
*
MsgText
[
mh_eMsg_
]
=
{
"NoMsg"
,
"ApplConnect"
,
"ApplDisconnect"
,
"ApplGetMsgInfo"
,
"ApplMessage"
,
"ApplReply"
,
"ApplReturn"
,
"ClearLists"
,
"Event"
,
"HandlerConnect"
,
"HandlerDisconnect"
,
"HandlerHello"
,
"HandlerSynchReply"
,
"HandlerSynchRequest"
,
"OutunitAck"
,
"OutunitBlock"
,
"OutunitConnect"
,
"OutunitDisconnect"
,
"OutunitHello"
,
"OutunitUpdate"
,
"OutunitSynchReply"
,
"OutunitSynchRequest"
,
"ProcDown"
,
"StopScanSup"
,
"StartScanSup"
};
if
(
fp
==
NULL
)
return
;
if
(
Event
=
(
Type
==
mh_eMsg_Event
))
TmpTime
=
Msg
->
EventTime
;
else
clock_gettime
(
CLOCK_REALTIME
,
&
TmpTime
);
TmpTm
=
localtime
(
&
TmpTime
.
tv_sec
);
sprintf
(
TimeStr
,
"%02d%02d%02d %02d:%02d:%02d.%02d"
,
TmpTm
->
tm_year
,
TmpTm
->
tm_mon
,
TmpTm
->
tm_mday
,
TmpTm
->
tm_hour
,
TmpTm
->
tm_min
,
TmpTm
->
tm_sec
,
TmpTime
.
tv_nsec
/
1e7
);
fprintf
(
fp
,
"%3d.%-4d %18s %19s %3d %10d %32s %8x %12s %4s %8x %10d
\n
"
,
QId
?
QId
->
nid
:
0
,
QId
?
QId
->
qix
:
0
,
TimeStr
,
MsgText
[
Type
],
Event
?
Msg
->
Id
.
Nix
:
0
,
Event
?
Msg
->
Id
.
Idx
:
0
,
Event
?
cdh_ObjidToString
(
NULL
,
Msg
->
Object
,
1
)
:
0
,
Event
?
Msg
->
EventFlags
:
0
,
Event
?
EventText
[
Msg
->
EventType
]
:
""
,
Event
&&
(
Msg
->
EventPrio
>=
mh_eEventPrio_D
&&
Msg
->
EventPrio
<=
mh_eEventPrio_A
)
?
PrioText
[
Msg
->
EventPrio
-
mh_eEventPrio_D
]
:
"0"
,
Event
&&
(
Msg
->
EventType
==
mh_eEvent_Info
||
Msg
->
EventType
==
mh_eEvent_Alarm
)
?
((
mh_sMessage
*
)
Msg
)
->
Status
:
0
,
ODD
(
sts
)
?
1
:
sts
);
fflush
(
fp
);
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment