include/Spectre/System/Log.h: Change message variable name to format.
This commit is contained in:
parent
2bb0cbaf6b
commit
9928a3599e
2 changed files with 18 additions and 18 deletions
|
|
@ -6,47 +6,47 @@
|
|||
namespace sp
|
||||
{
|
||||
|
||||
void Log::info(const char *message, ...) {
|
||||
void Log::info(const char *format, ...) {
|
||||
|
||||
va_list vl;
|
||||
|
||||
va_start(vl, message);
|
||||
writeln(T_INFO, message, vl);
|
||||
va_start(vl, format);
|
||||
writeln(T_INFO, format, vl);
|
||||
va_end(vl);
|
||||
}
|
||||
|
||||
void Log::warn(const char *message, ...)
|
||||
void Log::warn(const char *format, ...)
|
||||
{
|
||||
va_list vl;
|
||||
|
||||
va_start(vl, message);
|
||||
writeln(T_WARNING, message, vl);
|
||||
va_start(vl, format);
|
||||
writeln(T_WARNING, format, vl);
|
||||
va_end(vl);
|
||||
}
|
||||
|
||||
int Log::error(const char *message, ...)
|
||||
int Log::error(const char *format, ...)
|
||||
{
|
||||
va_list vl;
|
||||
|
||||
va_start(vl, message);
|
||||
writeln(T_ERROR, message, vl);
|
||||
va_start(vl, format);
|
||||
writeln(T_ERROR, format, vl);
|
||||
va_end(vl);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
void Log::debug(const char *message, ...)
|
||||
void Log::debug(const char *format, ...)
|
||||
{
|
||||
#ifdef SPECTRE_DEBUG
|
||||
va_list vl;
|
||||
|
||||
va_start(vl, message);
|
||||
writeln(T_DEBUG, message, vl);
|
||||
va_start(vl, format);
|
||||
writeln(T_DEBUG, format, vl);
|
||||
va_end(vl);
|
||||
#endif /* SPECTRE_DEBUG */
|
||||
}
|
||||
|
||||
void Log::writeln(Type type, const char *message, va_list args)
|
||||
void Log::writeln(Type type, const char *format, va_list args)
|
||||
{
|
||||
FILE *fd = stderr;
|
||||
static char buf[4096];
|
||||
|
|
@ -73,7 +73,7 @@ void Log::writeln(Type type, const char *message, va_list args)
|
|||
break;
|
||||
}
|
||||
|
||||
vsnprintf(buf, sizeof(buf), message, args);
|
||||
vsnprintf(buf, sizeof(buf), format, args);
|
||||
fprintf(fd, "%s: %s\n", prefix, buf);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue