logging: move parens to be in front of function #126

Merged
MartinFouilleul merged 2 commits from fix-log-parens into main 2023-09-18 10:19:24 +00:00
5 changed files with 18 additions and 18 deletions

View File

@ -45,8 +45,8 @@ oc_log_output* OC_LOG_DEFAULT_OUTPUT = &oc_logDefaultOutput;
void platform_log_push(oc_log_output* output,
oc_log_level level,
const char* file,
const char* function,
const char* file,
int line,
const char* fmt,
va_list ap)

View File

@ -50,18 +50,18 @@ static oc_log_output oc_logDefaultOutput = { .kind = ORCA_LOG_OUTPUT_CONSOLE };
oc_log_output* OC_LOG_DEFAULT_OUTPUT = &oc_logDefaultOutput;
void ORCA_IMPORT(oc_bridge_log)(oc_log_level level,
int fileLen,
const char* file,
int functionLen,
const char* function,
int fileLen,
const char* file,
int line,
int msgLen,
const char* msg);
void platform_log_push(oc_log_output* output,
oc_log_level level,
const char* file,
const char* function,
const char* file,
int line,
const char* fmt,
va_list ap)
@ -76,7 +76,7 @@ void platform_log_push(oc_log_output* output,
oc_str8 string = oc_str8_list_join(scratch.arena, ctx.list);
oc_bridge_log(level, strlen(file), file, strlen(function), function, line, oc_str8_ip(string));
oc_bridge_log(level, strlen(function), function, strlen(file), file, line, oc_str8_ip(string));
oc_scratch_end(scratch);
}

View File

@ -28,8 +28,8 @@ void oc_log_set_level(oc_log_level level)
void platform_log_push(oc_log_output* output,
oc_log_level level,
const char* file,
const char* function,
const char* file,
int line,
const char* fmt,
va_list ap);

View File

@ -134,10 +134,10 @@ void oc_bridge_clipboard_set_string(oc_wasm_str8 value)
}
void oc_bridge_log(oc_log_level level,
int fileLen,
char* file,
int functionLen,
char* function,
int fileLen,
char* file,
int line,
int msgLen,
char* msg)
@ -179,14 +179,14 @@ void oc_bridge_log(oc_log_level level,
}
char* payload = (char*)entry + sizeof(log_entry);
entry->file.len = fileLen;
entry->file.ptr = payload;
payload += entry->file.len;
entry->function.len = functionLen;
entry->function.ptr = payload;
payload += entry->function.len;
entry->file.len = fileLen;
entry->file.ptr = payload;
payload += entry->file.len;
entry->msg.len = msgLen;
entry->msg.ptr = payload;
payload += entry->msg.len;
@ -203,8 +203,8 @@ void oc_bridge_log(oc_log_level level,
oc_list_push_back(&debug->logEntries, &entry->listElt);
oc_log_ext(level,
file,
function,
file,
line,
"%.*s\n",
msgLen,

View File

@ -5,16 +5,16 @@
"ret": {"name": "void", "tag": "v"},
"args": [ {"name": "level",
"type": {"name": "oc_log_level", "tag": "i"}},
{"name": "fileLen",
"type": {"name": "int", "tag": "i"}},
{"name": "file",
"type": {"name": "char*", "tag": "p"},
"len": {"count": "fileLen"}},
{"name": "functionLen",
"type": {"name": "int", "tag": "i"}},
{"name": "function",
"type": {"name": "char*", "tag": "p"},
"len": {"count": "functionLen"}},
{"name": "fileLen",
"type": {"name": "int", "tag": "i"}},
{"name": "file",
"type": {"name": "char*", "tag": "p"},
"len": {"count": "fileLen"}},
{"name": "line",
"type": {"name": "int", "tag": "i"}},
{"name": "msgLen",