You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Almost all output goes to stdout with no levels: 299 cout against 28 cerr, mostly in Command.cpp, FireDomain.cpp and DataBroker.cpp.
This causes two problems:
A passing unit-test run prints 34 ERROR: vector of parameters … should be valued lines, and none of them is an error. A real error would look identical.
Simulation output (FireNode[…] lines) and diagnostics share one stream, so scripts cannot tell them apart.
Suggested fix: a small logging header with levels (error/warning/info/debug) and a runtime threshold, sending errors and warnings to stderr. Then reclassify the call sites, which can be done gradually.
Worth doing before ensembles (#172). Easier after #164 (std::source_location).
Drafted with Claude Opus 5, reviewed by a maintainer.
DataBroker, FireDomain and the layers write to cout directly. And even through outStream, results and errors are mixed: Error: No arguments provided. goes to the same place as print[]'s FireNode[...] lines.
The result is that even a green CI prints dozens of these on stdout: WARNING: could not load file for fuel properties .../fuels.ff Error: Data name 'noSuchParameter' not recognized.
Users and scripts can't tell which are errors and which should be ignored.
I tend to use logging frameworks a lot because they make things much cleaner. But we can have a smaller version if you prefer: send the lines that already start with ERROR/WARNING/Error: to stderr and leave the rest alone. Results stay on stdout. Would that be OK?
What I understood: today the code prints everything the same way, so a real error looks just like a normal result or a harmless warning. Hugo's idea is to tag each message so we can tell them apart, the same thing Python's logging does:
Python logging
ForeFire (example)
log.error("...")
FF_ERROR << "..."
log.warning("...")
FF_WARN << "..."
log.info / log.debug
FF_INFO / FF_DEBUG
basicConfig(level=WARNING)
setParameter[logLevel=warning]
Results stay exactly where they are. Only errors and warnings would go to stderr, and in a terminal you'd see the same thing as today. No new dependency, just a small header, and the change can be done file by file.
This assumes no script or Meso-NH run reads the errors from the output. If one does, we keep that working.
I like the idea. If @filippi is ok, Hugo, I can open a first small PR (header + a few files) and you review, or the other way around.
Discussed with Filippi. Instead of a new logging header sending to stderr, he prefers reusing Command::Session: replace direct cout with session.log(level, msg), writing to the session stream (default cout, so the WASM/listenHTTP capture keeps working), with levels as a bitmask (ERROR | WARN | INFO | DEBUG; quiet = ERROR only). This revives the unused debugMode/COMMAND_DEBUG, and the existing CommandOutputs switch maps to the DEBUG bit.
So results and diagnostics stay on one stream, separated by the mask rather than stdout/stderr. Filippi asked to hold off for now; when we pick it up, a first PR could cover Command.cpp only. Other files (FireFront, FireDomain, DataBroker) would need to depend on Command, to decide later.
Activity
filippi commentedon Oct 21, 2026
isnt'it passed trhous the static context ? only one outspreamrep per process i guess..i cannot understant the proposed fix.. maybe for later
HugoFara commentedon Oct 29, 2026
DataBroker, FireDomain and the layers write to
coutdirectly. And even throughoutStream, results and errors are mixed:Error: No arguments provided.goes to the same place asprint[]'s FireNode[...]lines.The result is that even a green CI prints dozens of these on
stdout:WARNING: could not load file for fuel properties .../fuels.ffError: Data name 'noSuchParameter' not recognized.Users and scripts can't tell which are errors and which should be ignored.
I tend to use logging frameworks a lot because they make things much cleaner. But we can have a smaller version if you prefer: send the lines that already start with ERROR/WARNING/Error: to stderr and leave the rest alone. Results stay on stdout. Would that be OK?
plot: use the WARNING: prefix for the non-square ASCII cells warning (f…
antonio-leblanc commentedon Nov 3, 2026
What I understood: today the code prints everything the same way, so a real error looks just like a normal result or a harmless warning. Hugo's idea is to tag each message so we can tell them apart, the same thing Python's
loggingdoes:logginglog.error("...")FF_ERROR << "..."log.warning("...")FF_WARN << "..."log.info/log.debugFF_INFO/FF_DEBUGbasicConfig(level=WARNING)setParameter[logLevel=warning]Results stay exactly where they are. Only errors and warnings would go to stderr, and in a terminal you'd see the same thing as today. No new dependency, just a small header, and the change can be done file by file.
This assumes no script or Meso-NH run reads the errors from the output. If one does, we keep that working.
I like the idea. If @filippi is ok, Hugo, I can open a first small PR (header + a few files) and you review, or the other way around.
plot: warn when ASCII cells are not square (#161) (#249)
antonio-leblanc commentedon Nov 10, 2026
Discussed with Filippi. Instead of a new logging header sending to stderr, he prefers reusing
Command::Session: replace directcoutwithsession.log(level, msg), writing to the session stream (defaultcout, so the WASM/listenHTTPcapture keeps working), with levels as a bitmask (ERROR | WARN | INFO | DEBUG; quiet =ERRORonly). This revives the unuseddebugMode/COMMAND_DEBUG, and the existingCommandOutputsswitch maps to theDEBUGbit.So results and diagnostics stay on one stream, separated by the mask rather than stdout/stderr. Filippi asked to hold off for now; when we pick it up, a first PR could cover
Command.cpponly. Other files (FireFront,FireDomain,DataBroker) would need to depend onCommand, to decide later.