source: WorldVistAEHR/trunk/r/RPC_BROKER-XWB/XWBDLOG.m@ 1714

Last change on this file since 1714 was 613, checked in by George Lilly, 15 years ago

initial load of WorldVistAEHR

File size: 1.8 KB
Line 
1XWBDLOG ;ISF/RWF - Debug Logging for Broker ;08/04/2004 13:56
2 ;;1.1;RPC BROKER;**35**;Mar 28, 1997
3 Q
4 ;
5 ;Setup the log, Clear the log location.
6LOGSTART(RTN) ;Clear the debug log
7 K ^XTMP("XWBLOG"_$J)
8 S ^XTMP("XWBLOG"_$J,0)=$$HTFM^XLFDT($$HADD^XLFDT($H,7))_"^"_$$DT^XLFDT
9 S ^XTMP("XWBLOG"_$J,.1)=0
10 D LOG("Log start: "_$$HTE^XLFDT($H)),LOG(RTN)
11 Q
12LOG(MSG) ;Record Debug Info
13 Q:'$G(XWBDEBUG)
14 N CNT
15 S CNT=1+$G(^XTMP("XWBLOG"_$J,.1)),^(.1)=CNT,^(CNT)=$E($H_"^"_MSG,1,255)
16 Q
17 ;
18 ;
19VIEW ;View log files
20 N DIRUT,XWB,DIR,IX,X,CON
21 D HOME^%ZIS
22 W !,"Log Files"
23 S XWB="XWBLOG",CON=""
24 F S XWB=$O(^XTMP(XWB)) Q:XWB'["XWBLOG" D
25 . D V1(.XWB)
26 . I $$WAIT(.CON) S:CON=3 XWB="XWC"
27 . Q
28 Q
29 ;
30V1(XWB) ;View one log
31 N IX,X,CNT
32 S IX=.9,X=$G(^XTMP(XWB,IX)),CON=0,CNT=+$G(^XTMP(XWB,.1))
33 Q:CNT<1
34 W !!,"Log from Job ",$E(XWB,7,99)," ",CNT," Lines"
35 F S IX=$O(^XTMP(XWB,IX)) Q:'$L(IX) S X=^XTMP(XWB,IX) D VL1(IX,X)
36 Q
37 ;
38VL1(J,K) ;Write a line
39 I $Y'<IOSL,$$WAIT(.CON) S IX="A" S:CON=3 XWB="XWC" Q
40 Q:'$D(^XTMP(XWB,IX))
41 N H,D,T,I
42 S H=$P($$HTE^XLFDT($P(K,"^"),"2S"),"@",2)_" = "
43 S D=$P(K,"^",2,99),K=D
44 I D?.E1C.E D
45 . S D=""
46 . F I=1:1:$L(K) S T=$A(K,I),D=D_$S(T>31:$E(K,I),1:"\"_$E((1000+T),3,4))
47 S T=$L(H)
48 F W !,H,?T,$E(D,1,68) S H="",D=$E(D,69,999) Q:'$L(D)
49 Q
50 ;
51WAIT(CON) ;continue/kill/exit
52 S DIR("?")="Enter RETURN to continue, Next for next log, Kill to remove log, Exit to quit log view."
53 S DIR("A")="Return to continue, Next log, Exit: "
54 S DIR(0)="SAB^1:Continue;2:Next;3:Exit;4:Kill",DIR("B")="Continue"
55 D ^DIR
56 S CON=+Y
57 I Y=4 D K1(XWB,0) H 1
58 I Y=1 W @IOF
59 Q Y>1
60 ;
61K1(REF,S) ;Kill one
62 I REF["XWBLOG" K ^XTMP(REF)
63 I 'S W !,"Log "_REF_" deleted."
64 Q
65 ;
66KILLALL ;KILL ALL LOG Entries
67 N DIR,XWB
68 S DIR(0)="Y",DIR("A")="Remove all XWB log entries",DIR("B")="No"
69 D ^DIR Q:Y'=1
70 S XWB="XWBLOG"
71 F S XWB=$O(^XTMP(XWB)) Q:XWB'["XWBLOG" D K1(XWB,1)
72 W !,"Done"
73 Q
Note: See TracBrowser for help on using the repository browser.