update naming

This commit is contained in:
Daniel Ledda
2025-02-09 14:02:44 +01:00
parent ec918c7bc8
commit f12b4091d7
6 changed files with 28 additions and 29 deletions

View File

@@ -383,29 +383,29 @@ string formatTimeYmd(Arena *arena, Timestamp *time) {
return buf;
}
void logErr(const char *fmt, ...) {
void printStderr(const char *fmt, ...) {
va_list argList;
va_start(argList, fmt);
os_log(LogTarget_stdout, fmt, argList);
os_print(StdStream_stdout, fmt, argList);
va_end(argList);
}
function void logStdout(const char *fmt, ...) {
function void printStdout(const char *fmt, ...) {
va_list argList;
va_start(argList, fmt);
os_log(LogTarget_stdout, fmt, argList);
os_print(StdStream_stdout, fmt, argList);
va_end(argList);
}
void log(const char *fmt, ...) {
void print(const char *fmt, ...) {
va_list argList;
va_start(argList, fmt);
os_log(LogTarget_stdout, fmt, argList);
os_print(StdStream_stdout, fmt, argList);
va_end(argList);
}
void log(list<int> l, LogTarget target) {
void (*logFn)(const char *fmt, ...) = target == LogTarget_stdout ? &logStdout : &logErr;
void print(list<int> l, StdStream target) {
void (*logFn)(const char *fmt, ...) = target == StdStream_stdout ? &printStdout : &printStderr;
logFn("{ ");
for (size_t i = 0; i < l.length; i++) {
if (i != 0) {
@@ -416,8 +416,8 @@ void log(list<int> l, LogTarget target) {
logFn(" } length: %zu, head: %zu\n", l.length, l.head);
}
void log(list<string> l, LogTarget target) {
void (*logFn)(const char *fmt, ...) = target == LogTarget_stdout ? &logStdout : &logErr;
void print(list<string> l, StdStream target) {
void (*logFn)(const char *fmt, ...) = target == StdStream_stdout ? &printStdout : &printStderr;
logFn("{ ");
for (size_t i = 0; i < l.length; i++) {
if (i != 0) {