| 99 | int clientloglinesremaining = INT_MAX; |
| 100 | |
| 101 | void clientlogf(const char *s, ...) |
| 102 | { |
| 103 | defvformatstring(sp, s, s); |
| 104 | filtertext(sp, sp, FTXT__LOG); |
| 105 | extern struct servercommandline scl; |
| 106 | const char *ts = scl.logtimestamp ? timestring(true, "%b %d %H:%M:%S ") : ""; |
| 107 | char *p, *l = sp; |
| 108 | do |
| 109 | { // break into single lines first |
| 110 | if((p = strchr(l, '\n'))) *p = '\0'; |
| 111 | printf("%s%s\n", ts, l); |
| 112 | if(clientlogfile) |
| 113 | { |
| 114 | clientlogfile->printf("%s%s\n", ts, l); |
| 115 | if(--clientloglinesremaining <= 0) DELETEP(clientlogfile); |
| 116 | } |
| 117 | else if(bootclientlog) cvecprintf(*bootclientlog, "%s%s\n", ts, l); |
| 118 | l = p + 1; |
| 119 | } |
| 120 | while(p); |
| 121 | } |
| 122 | SVAR(conline,"n/a"); |
| 123 | void conoutf(const char *s, ...) |
| 124 | { |
no test coverage detected