8.16.0.4
26 Printer
(require denxi/printer) | package: denxi |
denxi/printer writes messages as bytes on output ports.
setting
DENXI_FASL_OUTPUT : boolean? = #f
CLI Flags: -F/--fasl-output/--DENXI_FASL_OUTPUT
setting
CLI Flags: -R/--reader-friendly-output/--DENXI_READER_FRIENDLY_OUTPUT
When true, each program output value v is printed on STDOUT using
pretty-write without being translated to a human-readable message.
Use this to produce (read)able logs. If it aids read performance, combine with DENXI_FASL_OUTPUT.
setting
DENXI_VERBOSE : boolean? = #f
CLI Flags: -v/--verbose/--DENXI_VERBOSE
When true, emit more detailed program output.
procedure
(write-message-log messages format-message) → void?
messages : (or/c $message? subprogram-log/c) format-message : message-formatter/c
procedure
(write-message m [ #:newline? newline?] format-message [ out]) → void? m : $message? newline? : any/c = #t format-message : message-formatter/c out : output-port? = (current-output-port)
Writes a message to out according to the values of
(DENXI_READER_FRIENDLY_OUTPUT), (DENXI_FASL_OUTPUT),
and (DENXI_VERBOSE).
Given (and (not (DENXI_VERBOSE)) ($verbose? m)), write-message does nothing.
Otherwise, write-message does the following:
(let ([to-send (if (DENXI_READER_FRIENDLY_OUTPUT) m (format-message m))]) (if (DENXI_FASL_OUTPUT) (s-exp->fasl (serialize to-send) out) (if (DENXI_READER_FRIENDLY_OUTPUT) (pretty-write #:newline? newline? to-send out) ((if newline? displayln display) to-send out))))
Note that newline? is ignored when using fasl output.