... | ... |
@@ -206,6 +206,20 @@ static int download(const struct optstruct *opts, const char *datadir, const cha |
206 | 206 |
return ret; |
207 | 207 |
} |
208 | 208 |
|
209 |
+void msg_callback(enum cl_msg severity, const char *fullmsg, const char *msg, void *ctx) |
|
210 |
+{ |
|
211 |
+ switch (severity) { |
|
212 |
+ case CL_MSG_ERROR: |
|
213 |
+ logg("^[LibClamAV] %s", msg); |
|
214 |
+ break; |
|
215 |
+ case CL_MSG_WARN: |
|
216 |
+ logg("~[LibClamAV] %s", msg); |
|
217 |
+ default: |
|
218 |
+ logg("*[LibClamAV] %s", msg); |
|
219 |
+ break; |
|
220 |
+ } |
|
221 |
+} |
|
222 |
+ |
|
209 | 223 |
int main(int argc, char **argv) |
210 | 224 |
{ |
211 | 225 |
int ret = 52, retcl; |
... | ... |
@@ -369,6 +383,7 @@ int main(int argc, char **argv) |
369 | 369 |
} |
370 | 370 |
#endif |
371 | 371 |
|
372 |
+ cl_set_clcb_msg(msg_callback); |
|
372 | 373 |
/* change the current working directory */ |
373 | 374 |
if(chdir(optget(opts, "DatabaseDirectory")->strarg)) { |
374 | 375 |
logg("!Can't change dir to %s\n", optget(opts, "DatabaseDirectory")->strarg); |