Artifact
c4b480f5766a8307b3ad82839a57eb2e838faa2b:
- File
log.fs
— part of check-in
[2c969be80c]
at
2018-03-26 20:37:02
on branch trunk
— Remove needless net2o- prefix from files
(user:
bernd
size: 2120)
- File
net2o-log.fs
— part of check-in
[9b79640c42]
at
2016-08-08 19:35:22
on branch trunk
— Suppress needless warnings
(user:
bernd
size: 2120)
0000: 5c 20 6c 6f 67 20 64 75 6d 70 20 63 6c 61 73 73 \ log dump class
0010: 0a 0a 5c 20 43 6f 70 79 72 69 67 68 74 20 28 43 ..\ Copyright (C
0020: 29 20 32 30 31 31 2d 32 30 31 34 20 20 20 42 65 ) 2011-2014 Be
0030: 72 6e 64 20 50 61 79 73 61 6e 0a 0a 5c 20 54 68 rnd Paysan..\ Th
0040: 69 73 20 70 72 6f 67 72 61 6d 20 69 73 20 66 72 is program is fr
0050: 65 65 20 73 6f 66 74 77 61 72 65 3a 20 79 6f 75 ee software: you
0060: 20 63 61 6e 20 72 65 64 69 73 74 72 69 62 75 74 can redistribut
0070: 65 20 69 74 20 61 6e 64 2f 6f 72 20 6d 6f 64 69 e it and/or modi
0080: 66 79 0a 5c 20 69 74 20 75 6e 64 65 72 20 74 68 fy.\ it under th
0090: 65 20 74 65 72 6d 73 20 6f 66 20 74 68 65 20 47 e terms of the G
00a0: 4e 55 20 41 66 66 65 72 6f 20 47 65 6e 65 72 61 NU Affero Genera
00b0: 6c 20 50 75 62 6c 69 63 20 4c 69 63 65 6e 73 65 l Public License
00c0: 20 61 73 20 70 75 62 6c 69 73 68 65 64 20 62 79 as published by
00d0: 0a 5c 20 74 68 65 20 46 72 65 65 20 53 6f 66 74 .\ the Free Soft
00e0: 77 61 72 65 20 46 6f 75 6e 64 61 74 69 6f 6e 2c ware Foundation,
00f0: 20 65 69 74 68 65 72 20 76 65 72 73 69 6f 6e 20 either version
0100: 33 20 6f 66 20 74 68 65 20 4c 69 63 65 6e 73 65 3 of the License
0110: 2c 20 6f 72 0a 5c 20 28 61 74 20 79 6f 75 72 20 , or.\ (at your
0120: 6f 70 74 69 6f 6e 29 20 61 6e 79 20 6c 61 74 65 option) any late
0130: 72 20 76 65 72 73 69 6f 6e 2e 0a 0a 5c 20 54 68 r version...\ Th
0140: 69 73 20 70 72 6f 67 72 61 6d 20 69 73 20 64 69 is program is di
0150: 73 74 72 69 62 75 74 65 64 20 69 6e 20 74 68 65 stributed in the
0160: 20 68 6f 70 65 20 74 68 61 74 20 69 74 20 77 69 hope that it wi
0170: 6c 6c 20 62 65 20 75 73 65 66 75 6c 2c 0a 5c 20 ll be useful,.\
0180: 62 75 74 20 57 49 54 48 4f 55 54 20 41 4e 59 20 but WITHOUT ANY
0190: 57 41 52 52 41 4e 54 59 3b 20 77 69 74 68 6f 75 WARRANTY; withou
01a0: 74 20 65 76 65 6e 20 74 68 65 20 69 6d 70 6c 69 t even the impli
01b0: 65 64 20 77 61 72 72 61 6e 74 79 20 6f 66 0a 5c ed warranty of.\
01c0: 20 4d 45 52 43 48 41 4e 54 41 42 49 4c 49 54 59 MERCHANTABILITY
01d0: 20 6f 72 20 46 49 54 4e 45 53 53 20 46 4f 52 20 or FITNESS FOR
01e0: 41 20 50 41 52 54 49 43 55 4c 41 52 20 50 55 52 A PARTICULAR PUR
01f0: 50 4f 53 45 2e 20 20 53 65 65 20 74 68 65 0a 5c POSE. See the.\
0200: 20 47 4e 55 20 41 66 66 65 72 6f 20 47 65 6e 65 GNU Affero Gene
0210: 72 61 6c 20 50 75 62 6c 69 63 20 4c 69 63 65 6e ral Public Licen
0220: 73 65 20 66 6f 72 20 6d 6f 72 65 20 64 65 74 61 se for more deta
0230: 69 6c 73 2e 0a 0a 5c 20 59 6f 75 20 73 68 6f 75 ils...\ You shou
0240: 6c 64 20 68 61 76 65 20 72 65 63 65 69 76 65 64 ld have received
0250: 20 61 20 63 6f 70 79 20 6f 66 20 74 68 65 20 47 a copy of the G
0260: 4e 55 20 41 66 66 65 72 6f 20 47 65 6e 65 72 61 NU Affero Genera
0270: 6c 20 50 75 62 6c 69 63 20 4c 69 63 65 6e 73 65 l Public License
0280: 0a 5c 20 61 6c 6f 6e 67 20 77 69 74 68 20 74 68 .\ along with th
0290: 69 73 20 70 72 6f 67 72 61 6d 2e 20 20 49 66 20 is program. If
02a0: 6e 6f 74 2c 20 73 65 65 20 3c 68 74 74 70 3a 2f not, see <http:/
02b0: 2f 77 77 77 2e 67 6e 75 2e 6f 72 67 2f 6c 69 63 /www.gnu.org/lic
02c0: 65 6e 73 65 73 2f 3e 2e 0a 0a 72 65 70 6c 79 2d enses/>...reply-
02d0: 74 61 62 6c 65 20 24 40 20 69 6e 68 65 72 69 74 table $@ inherit
02e0: 2d 74 61 62 6c 65 20 6c 6f 67 2d 74 61 62 6c 65 -table log-table
02f0: 0a 0a 73 63 6f 70 65 7b 20 6e 65 74 32 6f 2d 62 ..scope{ net2o-b
0300: 61 73 65 0a 5c 67 20 0a 5c 67 20 23 23 23 20 6c ase.\g .\g ### l
0310: 6f 67 20 63 6f 6d 6d 61 6e 64 73 20 23 23 23 0a og commands ###.
0320: 5c 67 20 0a 6e 65 74 32 6f 27 20 74 6f 6b 65 6e \g .net2o' token
0330: 20 6e 65 74 32 6f 3a 20 6c 6f 67 2d 74 6f 6b 65 net2o: log-toke
0340: 6e 20 28 20 24 3a 74 6f 6b 65 6e 20 6e 20 2d 2d n ( $:token n --
0350: 20 29 0a 20 20 20 20 36 34 3e 6e 20 30 20 2e 72 ). 64>n 0 .r
0360: 20 2e 22 20 3a 22 20 24 3e 20 66 6f 72 74 68 3a ." :" $> forth:
0370: 74 79 70 65 20 73 70 61 63 65 20 3b 0a 0a 24 32 type space ;..$2
0380: 30 20 6e 65 74 32 6f 3a 20 65 6d 69 74 20 28 20 0 net2o: emit (
0390: 75 74 66 38 20 2d 2d 20 29 20 5c 67 20 65 6d 69 utf8 -- ) \g emi
03a0: 74 20 63 68 61 72 61 63 74 65 72 20 6f 6e 20 73 t character on s
03b0: 65 72 76 65 72 20 6c 6f 67 0a 20 20 20 20 36 34 erver log. 64
03c0: 3e 6e 20 78 65 6d 69 74 20 3b 0a 2b 6e 65 74 32 >n xemit ;.+net2
03d0: 6f 3a 20 74 79 70 65 20 28 20 24 3a 73 74 72 69 o: type ( $:stri
03e0: 6e 67 20 2d 2d 20 29 20 5c 67 20 74 79 70 65 20 ng -- ) \g type
03f0: 73 74 72 69 6e 67 20 6f 6e 20 73 65 72 76 65 72 string on server
0400: 20 6c 6f 67 0a 20 20 20 20 24 3e 20 66 6f 72 74 log. $> fort
0410: 68 3a 74 79 70 65 20 3b 0a 2b 6e 65 74 32 6f 3a h:type ;.+net2o:
0420: 20 63 72 20 28 20 2d 2d 20 29 20 5c 67 20 6e 65 cr ( -- ) \g ne
0430: 77 6c 69 6e 65 20 6f 6e 20 73 65 72 76 65 72 20 wline on server
0440: 6c 6f 67 0a 20 20 20 20 66 6f 72 74 68 3a 63 72 log. forth:cr
0450: 20 3b 0a 30 20 77 61 72 6e 69 6e 67 73 20 21 40 ;.0 warnings !@
0460: 20 5c 20 64 69 73 61 62 6c 65 20 77 61 72 6e 69 \ disable warni
0470: 6e 67 73 20 66 6f 72 20 2e 0a 2b 6e 65 74 32 6f ngs for ..+net2o
0480: 3a 20 2e 20 28 20 6e 20 2d 2d 20 29 20 5c 67 20 : . ( n -- ) \g
0490: 70 72 69 6e 74 20 6e 75 6d 62 65 72 20 6f 6e 20 print number on
04a0: 73 65 72 76 65 72 20 6c 6f 67 0a 20 20 20 20 75 server log. u
04b0: 36 34 2e 20 3b 0a 77 61 72 6e 69 6e 67 73 20 21 64. ;.warnings !
04c0: 0a 2b 6e 65 74 32 6f 3a 20 66 2e 20 28 20 72 20 .+net2o: f. ( r
04d0: 2d 2d 20 29 20 5c 67 20 70 72 69 6e 74 20 66 70 -- ) \g print fp
04e0: 20 6e 75 6d 62 65 72 20 6f 6e 20 73 65 72 76 65 number on serve
04f0: 72 20 6c 6f 67 0a 20 20 20 20 66 6f 72 74 68 3a r log. forth:
0500: 66 2e 20 3b 0a 2b 6e 65 74 32 6f 3a 20 2e 74 69 f. ;.+net2o: .ti
0510: 6d 65 20 28 20 2d 2d 20 29 20 5c 67 20 70 72 69 me ( -- ) \g pri
0520: 6e 74 20 74 69 6d 65 72 20 74 6f 20 73 65 72 76 nt timer to serv
0530: 65 72 20 6c 6f 67 0a 20 20 20 20 66 6f 72 74 68 er log. forth
0540: 3a 2e 74 69 6d 65 20 2e 70 61 63 6b 65 74 73 20 :.time .packets
0550: 70 72 6f 66 69 6c 65 28 20 2e 74 69 6d 65 73 20 profile( .times
0560: 29 20 3b 0a 2b 6e 65 74 32 6f 3a 20 21 74 69 6d ) ;.+net2o: !tim
0570: 65 20 28 20 2d 2d 20 29 20 5c 67 20 73 74 61 72 e ( -- ) \g star
0580: 74 20 74 69 6d 65 72 0a 20 20 20 20 66 6f 72 74 t timer. fort
0590: 68 3a 21 74 69 6d 65 20 69 6e 69 74 2d 74 69 6d h:!time init-tim
05a0: 65 72 20 3b 0a 0a 67 65 6e 2d 74 61 62 6c 65 20 er ;..gen-table
05b0: 24 66 72 65 65 7a 65 0a 27 20 63 6f 6e 74 65 78 $freeze.' contex
05c0: 74 2d 74 61 62 6c 65 20 69 73 20 67 65 6e 2d 74 t-table is gen-t
05d0: 61 62 6c 65 0a 0a 24 33 32 20 6e 65 74 32 6f 3a able..$32 net2o:
05e0: 20 6c 6f 67 20 28 20 2d 2d 20 6f 3a 6c 6f 67 20 log ( -- o:log
05f0: 29 0a 20 20 20 20 6c 6f 67 2d 63 6f 6e 74 65 78 ). log-contex
0600: 74 20 40 20 64 75 70 20 30 3d 20 49 46 0a 09 64 t @ dup 0= IF..d
0610: 72 6f 70 20 20 6e 32 6f 3a 6e 65 77 2d 6c 6f 67 rop n2o:new-log
0620: 20 64 75 70 20 6c 6f 67 2d 63 6f 6e 74 65 78 74 dup log-context
0630: 20 21 0a 20 20 20 20 54 48 45 4e 20 20 6e 3a 3e !. THEN n:>
0640: 6f 20 3b 0a 6c 6f 67 2d 74 61 62 6c 65 20 3e 74 o ;.log-table >t
0650: 61 62 6c 65 0a 0a 7d 73 63 6f 70 65 0a 0a 30 20 able..}scope..0
0660: 5b 49 46 5d 0a 4c 6f 63 61 6c 20 56 61 72 69 61 [IF].Local Varia
0670: 62 6c 65 73 3a 0a 66 6f 72 74 68 2d 6c 6f 63 61 bles:.forth-loca
0680: 6c 2d 77 6f 72 64 73 3a 0a 20 20 20 20 28 0a 20 l-words:. (.
0690: 20 20 20 20 28 28 22 6e 65 74 32 6f 3a 22 20 22 (("net2o:" "
06a0: 2b 6e 65 74 32 6f 3a 22 29 20 64 65 66 69 6e 69 +net2o:") defini
06b0: 74 69 6f 6e 2d 73 74 61 72 74 65 72 20 28 66 6f tion-starter (fo
06c0: 6e 74 2d 6c 6f 63 6b 2d 6b 65 79 77 6f 72 64 2d nt-lock-keyword-
06d0: 66 61 63 65 20 2e 20 31 29 0a 20 20 20 20 20 20 face . 1).
06e0: 22 5b 20 5c 74 5c 6e 5d 22 20 74 20 6e 61 6d 65 "[ \t\n]" t name
06f0: 20 28 66 6f 6e 74 2d 6c 6f 63 6b 2d 66 75 6e 63 (font-lock-func
0700: 74 69 6f 6e 2d 6e 61 6d 65 2d 66 61 63 65 20 2e tion-name-face .
0710: 20 33 29 29 0a 20 20 20 20 20 28 22 5b 61 2d 7a 3)). ("[a-z
0720: 5c 2d 30 2d 39 5d 2b 28 22 20 69 6d 6d 65 64 69 \-0-9]+(" immedi
0730: 61 74 65 20 28 66 6f 6e 74 2d 6c 6f 63 6b 2d 63 ate (font-lock-c
0740: 6f 6d 6d 65 6e 74 2d 66 61 63 65 20 2e 20 31 29 omment-face . 1)
0750: 0a 20 20 20 20 20 20 22 29 22 20 6e 69 6c 20 63 . ")" nil c
0760: 6f 6d 6d 65 6e 74 20 28 66 6f 6e 74 2d 6c 6f 63 omment (font-loc
0770: 6b 2d 63 6f 6d 6d 65 6e 74 2d 66 61 63 65 20 2e k-comment-face .
0780: 20 31 29 29 0a 20 20 20 20 29 0a 66 6f 72 74 68 1)). ).forth
0790: 2d 6c 6f 63 61 6c 2d 69 6e 64 65 6e 74 2d 77 6f -local-indent-wo
07a0: 72 64 73 3a 0a 20 20 20 20 28 0a 20 20 20 20 20 rds:. (.
07b0: 28 28 22 6e 65 74 32 6f 3a 22 20 22 2b 6e 65 74 (("net2o:" "+net
07c0: 32 6f 3a 22 29 20 28 30 20 2e 20 32 29 20 28 30 2o:") (0 . 2) (0
07d0: 20 2e 20 32 29 20 6e 6f 6e 2d 69 6d 6d 65 64 69 . 2) non-immedi
07e0: 61 74 65 29 0a 20 20 20 20 20 28 28 22 5b 3a 22 ate). (("[:"
07f0: 29 20 28 30 20 2e 20 31 29 20 28 30 20 2e 20 31 ) (0 . 1) (0 . 1
0800: 29 20 69 6d 6d 65 64 69 61 74 65 29 0a 20 20 20 ) immediate).
0810: 20 20 28 28 22 3b 5d 22 29 20 28 2d 31 20 2e 20 ((";]") (-1 .
0820: 30 29 20 28 30 20 2e 20 2d 31 29 20 69 6d 6d 65 0) (0 . -1) imme
0830: 64 69 61 74 65 29 0a 20 20 20 20 29 0a 45 6e 64 diate). ).End
0840: 3a 0a 5b 54 48 45 4e 5d :.[THEN]