Skip to content

Commit 270222b

Browse files
author
Sonny Martin
committed
Add info about json, xml and clarify exceptions
1 parent b9424c8 commit 270222b

File tree

1 file changed

+31
-12
lines changed

1 file changed

+31
-12
lines changed

src/util/README.md

Lines changed: 31 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -315,8 +315,8 @@ The deserialisation does the oposite process and it is implemented in
315315
\subsubsection irep-serialization-strings Serialization of Strings
316316

317317
A string is encoded as classic 0-terminated C string. However,
318-
characters `0` and `\\` are escaped by writing additional `\\`
319-
before them.
318+
characters `0` and `\\` are escaped by writing additional `\\`
319+
before them.
320320

321321
This is implmented in the function `::write_gb_string` and the
322322
deserialisation is implemented in `irep_serializationt::read_gb_string`.
@@ -329,18 +329,37 @@ serialisation queries save only that integer hash code of the string.
329329

330330
\subsubsection irep-serialization-ireps Serialization of `irept` Instances
331331

332-
332+
<br>
333333
\subsection CProver-output CProver output - printing
334-
Cprover has 3 principal types of output:
334+
CProver has 3 types of output:
335+
336+
* messages - filtered by a 'verbosity' level.
335337

336-
* direct output via std::cout & std::cerr (these are in the process of being removed).
338+
\ref messaget provides messages with a built-in verbosity level.
339+
These are then processed by a subclass of \ref message_handlert - which
340+
filters out all messages above a set verbosity level.
341+
An example of this is \ref stream_message_handlert and its subtypes, which
342+
directs messages to an output stream (`std::cout` & `std::cerr`, `std::clog` is not used).
343+
CProver output can be in plain text, json or xml. By default the verbosity
344+
filtering is set to the maximum level (10), i.e. all messages are printed
345+
(level 10 messages are debug information).
346+
Message level information can be found in \ref messaget.
337347

338348
* output from invariants / exceptions
339-
Invariants output to std::cerr - and provide a backtrace and optionally some diagnostic information.
340-
For more information on invariants, see `invariant.h`
341-
Exceptions also print to std::cerr - and have a standard 'what()' interface. More information on exceptions can be found in `exception_utils.h`.
342349

343-
* messages - filtered by a 'verbosity' level.
344-
\ref messaget provides messages with a built-in verbosity 'level'.
345-
These are then processed by a subclass of \ref message_handlert - which filters out all messages above a set verbosity level. An example of this is \ref stream_message_handlert and its subtypes, which directs messages to an output stream (std::cout & std::cerr - std::log is not used).
346-
By default the verbosity filtering level is set to the maximum level (10) - all messages are printed (level 10 messages are debug information). Message level information can be found in \ref messaget.
350+
Invariants output to `std::cerr` - and provide a backtrace and optionally
351+
some diagnostic information.
352+
For more information on invariants, see `invariant.h`
353+
Exceptions have a standard `what()` interface. Best practice for exceptions
354+
is for the output of `what()` to be routed via a message with verbosity level 1
355+
(as returned by `messaget::error()`). The message is then processed by a
356+
message_handler. Where plain text output (versus json or xml output) is
357+
chosen, exceptions print (indirectly) to `std::cerr`.
358+
Json and xml output always goes to `std::cout`.
359+
More information on exceptions can be found in `exception_utils.h`.
360+
361+
* direct output via `std::cout` & `std::cerr`
362+
363+
These are in the process of being removed - no new output should go
364+
via `std::cout` or `std::cerr`, but should instead use the
365+
\ref messaget and \ref message_handlert infrastructure.

0 commit comments

Comments
 (0)