Make Session_object::warning const

This allows the use of the label-prefixed log utilities from a const
method of a derived class.
This commit is contained in:
Norman Feske 2024-01-03 17:57:56 +01:00 committed by Christian Helmuth
parent 8b5aa538e7
commit 41731a2439

View File

@ -102,7 +102,7 @@ class Genode::Session_object : private Ram_quota_guard,
* mode (defined via the 'diag' session argument). * mode (defined via the 'diag' session argument).
*/ */
template <typename... ARGS> template <typename... ARGS>
void diag(ARGS &&... args) void diag(ARGS &&... args) const
{ {
if (_diag.enabled) if (_diag.enabled)
log(RPC_INTERFACE::service_name(), " (", _label, ") ", args...); log(RPC_INTERFACE::service_name(), " (", _label, ") ", args...);
@ -112,7 +112,7 @@ class Genode::Session_object : private Ram_quota_guard,
* Output label-prefixed error message * Output label-prefixed error message
*/ */
template <typename... ARGS> template <typename... ARGS>
void error(ARGS &&... args) void error(ARGS &&... args) const
{ {
Genode::error(RPC_INTERFACE::service_name(), " (", _label, ") ", args...); Genode::error(RPC_INTERFACE::service_name(), " (", _label, ") ", args...);
} }
@ -121,7 +121,7 @@ class Genode::Session_object : private Ram_quota_guard,
* Output label-prefixed error message * Output label-prefixed error message
*/ */
template <typename... ARGS> template <typename... ARGS>
void warning(ARGS &&... args) void warning(ARGS &&... args) const
{ {
Genode::warning(RPC_INTERFACE::service_name(), " (", _label, ") ", args...); Genode::warning(RPC_INTERFACE::service_name(), " (", _label, ") ", args...);
} }