#include #include #include #include "time_defs.h" void log_do(char *buf,int OK, char *program, char *username, char *tty) /*EXTRACT_INCL*/{ char *p=buf; *p++ ='<'; p += fmt_ulong(p, (10<<3) | (4+2*OK)); /* 4 warn, 5 notice, 6 info */ *p++ = '>'; nv_ctime(p,time(0), 26); p += str_add(p,p+4,16); p += str_add(p,program,32); *p++='['; p += fmt_ulong(p,getpid()); p += str_copy(p,"]: "); p += str_add(p,username,32); p += str_copy(p, (OK) ? " logged on " : " fail on "); p += str_add(p,tty,32); *p++ = '\n'; write_devlog(buf, p-buf); }