1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-29 14:53:16 +02:00

convert some printError calls to logError

This commit is contained in:
Ben Burdette 2020-05-03 08:01:25 -06:00
parent 4b99c09f5c
commit ab6f0b9641
19 changed files with 195 additions and 70 deletions

View file

@ -25,7 +25,7 @@ void setAffinityTo(int cpu)
CPU_ZERO(&newAffinity);
CPU_SET(cpu, &newAffinity);
if (sched_setaffinity(0, sizeof(cpu_set_t), &newAffinity) == -1)
printError(format("failed to lock thread to CPU %1%") % cpu);
printError("failed to lock thread to CPU %1%", cpu);
#endif
}
@ -47,7 +47,7 @@ void restoreAffinity()
#if __linux__
if (!didSaveAffinity) return;
if (sched_setaffinity(0, sizeof(cpu_set_t), &savedAffinity) == -1)
printError("failed to restore affinity %1%");
_printError("failed to restore affinity");
#endif
}

View file

@ -117,6 +117,12 @@ public:
}
{ }
BaseError(hintformat hint)
: err { .level = lvlError,
.hint = hint
}
{ }
BaseError(ErrorInfo e)
: err(e)
{ }

View file

@ -149,6 +149,7 @@ extern Verbosity verbosity; /* suppress msgs > this */
} \
} while (0)
#define _printError(args...) printMsg(lvlError, args)
#define printError(args...) printMsg(lvlError, args)
#define printInfo(args...) printMsg(lvlInfo, args)
#define printTalkative(args...) printMsg(lvlTalkative, args)

View file

@ -1417,15 +1417,15 @@ string base64Decode(const string & s)
}
void callFailure(const std::function<void(std::exception_ptr exc)> & failure, std::exception_ptr exc)
{
try {
failure(exc);
} catch (std::exception & e) {
printError("uncaught exception: %s", e.what());
abort();
}
}
// void callFailure(const std::function<void(std::exception_ptr exc)> & failure, std::exception_ptr exc)
// {
// try {
// failure(exc);
// } catch (std::exception & e) {
// printError("uncaught exception: %s", e.what());
// abort();
// }
// }
static Sync<std::pair<unsigned short, unsigned short>> windowSize{{0, 0}};