[REBOL] patching print & probe so they log to a file disk. [logs] [print] [probe]
From: maximo::meteorstudios::com at: 25-Mar-2004 11:30
Hi Giuseppe,
I changed subject,
in order to get some feedback after a crash, you can add this before running your code:
;--------8<--------- invisible logging --------8<--------
log-file: %/path/to/file.txt
*print: :print
print: func [data /log][
if not log [*print data]
write/append log-file append reform data "^/"
]
*probe: :probe
probe: func [data /log][
if not log [*probe data]
write/append log-file append reform data "^/"
]
;--------8<--------- invisible logging --------8<--------
this wont' cure all your problems, but now, at least, whatever you print or probe, gets
logged to a file, so you can print as much info as you can and review what happened AFTER
the crash... that's what I do when I get to a point where code becomes unstable.
It helped me find my crashing glayout issue.
can anyone tell me if there is a function which is used to add trace messages even if
only for netword stuff... maybe we can patch that one too so that trace gets silently
dumped to a file too... :-)
would be nice for off-line stats and access logs too.
-MAx
---
You can either be part of the problem or part of the solution, but in the end, being
part of the problem is much more fun.