package tezt
Install
dune-project
Dependency
Authors
Maintainers
Sources
md5=15abf8d74a268d18dd42e539f894fbe8
sha512=fb30fc561a1e77f037a4ce7eb022345ef0620fa1ac3e16bd83b7f867ef3d0c0ff676255a967d3122e7ef25b22f4b0dc01fba9fe90fe1b486e68b268ba1e9a9c9
doc/tezt.core/Tezt_core/Log/index.html
Module Tezt_core.LogSource
Tezt logs.
Quote or escape a string using shell syntax.
Quote or escape a command with arguments using shell syntax.
Colors
Logging
val log :
level:Cli.Logs.level ->
?color:Color.t ->
?prefix:string ->
('a, Format.formatter, unit, unit) format4 ->
'aLog a message if the log level requested on the command-line allows it.
See the documentation of Cli for a description of each log level and when to use them.
In tests, you should mostly use function info.
val debug :
?color:Color.t ->
?prefix:string ->
('a, Format.formatter, unit, unit) format4 ->
'aSame as log ~level:Debug.
val info :
?color:Color.t ->
?prefix:string ->
('a, Format.formatter, unit, unit) format4 ->
'aSame as log ~level:Info.
val report :
?color:Color.t ->
?prefix:string ->
('a, Format.formatter, unit, unit) format4 ->
'aSame as log ~level:Report.
Same as log ~level:Warn ~color:red ~prefix:"warn".
Same as log ~level:Error ~color:red ~prefix:"error".
Whether a test succeeded, failed or was aborted by the user.
Failed comes with the error message, which is a string version of the exception that was raised (usually with Test.fail). This message is unused by the Log module itself.
val test_result :
test_index:int ->
test_count:int ->
failure_count:int ->
iteration:int ->
test_result ->
string ->
unitLog the result of a test.
test_index is the index of the test, starting from 1. test_count is the total number of tests. failure_count is the total number of failures so far.
iteration is the index of the iteration count to display in --loop mode.
The string argument is the name of the test.
Log a command which will be run.
Log it with level Debug, and print it unconditionally with no timestamp if Cli.options.commands is true.
Set the worker id to print if --log-worker-ids is set.
Close the current log file, if any, and open another one.
By default, logs are output to Cli.Logs.file, if it is specified (with --log-file). One can use set_file to change this. This is in particular done automatically when using -j: each child process calls set_file to write to its own file.
Flush current log file, if any.
Clear the message queue.
Messages that are not printed immediately because of their log level are stored in a queue so that they can be printed in case an error log is printed, to give some context. Call clear_error_context_queue to clear this queue.