A klammer set's Python speaks through the log

Assembled from development commit d5f9c20b94b3. Since 5c29da5: a print() in
@eval, or in any Python a klammer set runs, is a log line -- on the
error stream under the command's name at -v 1, silent otherwise, never
in the document -- and K_log(level, text) is the builtin behind it; a
Python script using the binding keeps its own stdout. Previously such
output was lost, or on a terminal landed in the document.
This commit is contained in:
ack committed 2026-09-25 23:08:26 +02:00
1 parent 5c29da52dc
commit fc2e848e91
7 files changed
+126 -3

No files matched your search

+4
View File
@@ -9,6 +9,7 @@
#include <tuple>
#include "argv.h"
#include "eval_python.h"
#include "file.h"
#include "log.h"
#include "machine.h"
@@ -73,6 +74,9 @@ void set_verbose_level(int argc, char* argv[])
args.opt("v", "'verbosity'", "level", "0", "'verbosity'");
args.parse(argc, argv, false);
verbose_level = args.as_verbosity("v");
// A klammer set's Python speaks through the log (eval_python.h): the
// commands only -- the binding leaves the host's sys.stdout alone.
set_python_output_to_log(true);
#ifdef _WIN32
if (console_output_cp != 0 && console_output_cp != CP_UTF8) {
K::log(1, "Console output code page set to UTF-8 for this run (was "