trace: redirect logs to trace based on policy
If trace is enabled for component than an attempt to put message into trace buffer is performed using log_output policy. If it succeeds than message is not put to logs using log service. Fixes #3714
This commit is contained in:
committed by
Christian Helmuth
parent
db8ec81e9f
commit
870d348d77
@@ -417,6 +417,16 @@ class Genode::Thread
|
||||
_logger()->log(cstring, strlen(cstring));
|
||||
}
|
||||
|
||||
/**
|
||||
* Log null-terminated string as trace event using log_output policy
|
||||
*
|
||||
* \return true if trace is really put to buffer
|
||||
*/
|
||||
static bool trace_captured(char const *cstring)
|
||||
{
|
||||
return _logger()->log_captured(cstring, strlen(cstring));
|
||||
}
|
||||
|
||||
/**
|
||||
* Log binary data as trace event
|
||||
*/
|
||||
|
||||
@@ -67,6 +67,13 @@ struct Genode::Trace::Logger
|
||||
*/
|
||||
void log(char const *, size_t);
|
||||
|
||||
/**
|
||||
* Log binary data to trace buffer using log_output policy
|
||||
*
|
||||
* \return true if log is really put to buffer
|
||||
*/
|
||||
bool log_captured(char const *, size_t);
|
||||
|
||||
/**
|
||||
* Log event to trace buffer
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user