Logs: compact small hex numbers

This commit is contained in:
Ivan Chikish 2023-07-14 15:01:36 +03:00
parent 81c7920a73
commit d89f315bd8
2 changed files with 7 additions and 3 deletions

View File

@ -7,9 +7,14 @@
#include <unistd.h>
#include <vector>
static void append_hex(std::string &out, std::uintmax_t value) {
static void append_hex(std::string &out, std::unsigned_integral auto value) {
std::ostringstream buf;
buf << "0x" << std::hex << value;
if (value < 10)
buf << value;
else if (value >= decltype(value)(UINTMAX_MAX) - 1)
buf << "-" << -value;
else
buf << "0x" << std::hex << value;
out += buf.str();
}

View File

@ -114,7 +114,6 @@ orbis::SysResult virtual_query(orbis::Thread *thread,
orbis::SysResult open(orbis::Thread *thread, orbis::ptr<const char> path,
orbis::sint flags, orbis::sint mode) {
ORBIS_LOG_NOTICE("sys_open", path, flags, mode);
orbis::Ref<IoDeviceInstance> instance;
auto result = rx::vfs::open(path, flags, mode, &instance);
if (result.isError()) {