mirror of
https://github.com/amadvance/snapraid.git
synced 2026-11-29 03:16:59 -05:00
Add a new informational error level for messages
This commit is contained in:
parent
b7dcf8659e
commit
af0b3c8451
4 changed files with 51 additions and 13 deletions
|
|
@ -418,6 +418,35 @@ void log_error(int err, const char* format, ...)
|
|||
unlock_msg();
|
||||
}
|
||||
|
||||
|
||||
void log_info(int err, const char* format, ...)
|
||||
{
|
||||
va_list ap;
|
||||
|
||||
lock_msg();
|
||||
|
||||
if (stdlog) {
|
||||
if (is_hw(err))
|
||||
fprintf(stdlog, "msg:error_hardware: "); /* we never expect an hardware error */
|
||||
else
|
||||
fprintf(stdlog, "msg:info: ");
|
||||
|
||||
va_start(ap, format);
|
||||
vfprintf(stdlog, format, ap);
|
||||
va_end(ap);
|
||||
|
||||
fflush(stdlog);
|
||||
} else {
|
||||
va_start(ap, format);
|
||||
vmsg(stderr, format, ap);
|
||||
va_end(ap);
|
||||
|
||||
fflush(stderr);
|
||||
}
|
||||
|
||||
unlock_msg();
|
||||
}
|
||||
|
||||
void log_expected(int err, const char* format, ...)
|
||||
{
|
||||
va_list ap;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue