mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 01:17:35 +00:00
AK: Replace LogStream operator for ReadonlyBytes with dump_bytes.
It wasn't actually possible to call const LogStream& operator<<(const LogStream&, ReadonlyBytes); because it was shadowed by template<typename T> const LogStream& operator<<(const LogStream& stream, Span<T> span); not sure how I didn't find this when I added the overload. It would be possible to use SFINAE to disable the other overload, however, I think it is better to use a different method entirely because the output can be very verbose: void dump_bytes(ReadonlyBytes);
This commit is contained in:
parent
06218a4074
commit
0055a28710
2 changed files with 4 additions and 3 deletions
|
@ -209,7 +209,7 @@ const LogStream& operator<<(const LogStream& stream, float value)
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
const LogStream& operator<<(const LogStream& stream, ReadonlyBytes bytes)
|
void dump_bytes(ReadonlyBytes bytes)
|
||||||
{
|
{
|
||||||
StringBuilder builder;
|
StringBuilder builder;
|
||||||
|
|
||||||
|
@ -247,7 +247,7 @@ const LogStream& operator<<(const LogStream& stream, ReadonlyBytes bytes)
|
||||||
|
|
||||||
builder.append(" }");
|
builder.append(" }");
|
||||||
|
|
||||||
return stream << builder.to_string();
|
dbg() << builder.to_string();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -184,7 +184,6 @@ const LogStream& operator<<(const LogStream& stream, Span<T> span)
|
||||||
}
|
}
|
||||||
|
|
||||||
const LogStream& operator<<(const LogStream&, const void*);
|
const LogStream& operator<<(const LogStream&, const void*);
|
||||||
const LogStream& operator<<(const LogStream&, ReadonlyBytes);
|
|
||||||
|
|
||||||
inline const LogStream& operator<<(const LogStream& stream, char value)
|
inline const LogStream& operator<<(const LogStream& stream, char value)
|
||||||
{
|
{
|
||||||
|
@ -205,6 +204,8 @@ KernelLogStream klog();
|
||||||
DebugLogStream klog();
|
DebugLogStream klog();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
void dump_bytes(ReadonlyBytes);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
using AK::dbg;
|
using AK::dbg;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue