35 if (!stralloc_copyb(&line,
num,fmt_ulong(
num,(
unsigned long)
now())))
return;
36 if (!stralloc_cats(&line,
" "))
return;
37 if (!stralloc_cats(&line,event))
return;
38 if (!stralloc_cats(&line,
" "))
return;
39 while ((ch = *
addr++)) {
40 if ((ch < 33) || (ch > 126)) ch =
'?';
41 if (!stralloc_append(&line,&ch))
return;
44 if (!stralloc_cats(&line,
" "))
return;
49 if ((ch < 32) || (ch > 126)) ch =
'?';
50 if (!stralloc_append(&line,&ch))
return;
53 if (!stralloc_cats(&line,
"\n"))
return;
55 if (!stralloc_copys(&
fn,
dir))
return;
56 if (!stralloc_cats(&
fn,
"/Log"))
return;
57 if (!stralloc_0(&
fn))
return;
59 fd = open_append(
fn.s);
61 buffer_init(&bl,buffer_unixwrite,
fd,logbuf,
sizeof(logbuf));
62 buffer_putflush(&bl,line.s,line.len);