Improve logger API (#262)

This breaking change improves naming consistency.

- Rename LOGF to INFOF
- Rename recently introduced ANYF to LOGF
- Remove V* log calls, as they are not being used
This commit is contained in:
Paul Kulchenko 2021-09-03 21:14:26 -07:00 committed by GitHub
parent 50937be752
commit 0584684a82
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 174 additions and 261 deletions

View file

@ -204,7 +204,7 @@ void StartTcpServer(void) {
CHECK_NE(-1, listen(g_servfd, 10));
asize = sizeof(g_servaddr);
CHECK_NE(-1, getsockname(g_servfd, &g_servaddr, &asize));
LOGF("%s:%s", "listening on tcp", gc(DescribeAddress(&g_servaddr)));
INFOF("%s:%s", "listening on tcp", gc(DescribeAddress(&g_servaddr)));
if (g_sendready) {
printf("ready %hu\n", ntohs(g_servaddr.sin_port));
fflush(stdout);
@ -306,8 +306,8 @@ void HandleClient(void) {
exename = gc(calloc(1, namesize + 1));
Recv(exename, namesize);
g_exepath = gc(xasprintf("o/%d.%s", getpid(), basename(exename)));
LOGF("%s asked we run %`'s (%,u bytes @ %`'s)", addrstr, exename, filesize,
g_exepath);
INFOF("%s asked we run %`'s (%,u bytes @ %`'s)", addrstr, exename, filesize,
g_exepath);
exe = malloc(filesize);
Recv(exe, filesize);
@ -428,9 +428,9 @@ int Serve(void) {
}
close(g_servfd);
if (!g_timeout) {
LOGF("timeout expired, shutting down");
INFOF("timeout expired, shutting down");
} else {
LOGF("got ctrl-c, shutting down");
INFOF("got ctrl-c, shutting down");
}
return 0;
}