1
0
mirror of https://github.com/GOSTSec/sgminer synced 2025-01-31 08:54:19 +00:00

logging spaces/indentation

This commit is contained in:
troky 2014-06-10 17:13:54 +02:00
parent cbc22823df
commit 6971ce6fe0
2 changed files with 25 additions and 25 deletions

View File

@ -102,35 +102,35 @@ void _applog(int prio, const char *str, bool force)
/* Day changed. */ /* Day changed. */
if (opt_log_show_date && (last_date_output_day != tm->tm_mday)) { if (opt_log_show_date && (last_date_output_day != tm->tm_mday)) {
last_date_output_day = tm->tm_mday; last_date_output_day = tm->tm_mday;
char date_output_str[64]; char date_output_str[64];
snprintf(date_output_str, sizeof(date_output_str), "Log date is now %d-%02d-%02d", snprintf(date_output_str, sizeof(date_output_str), "Log date is now %d-%02d-%02d",
tm->tm_year + 1900, tm->tm_year + 1900,
tm->tm_mon + 1, tm->tm_mon + 1,
tm->tm_mday); tm->tm_mday);
_applog(prio, date_output_str, force); _applog(prio, date_output_str, force);
} }
if (opt_log_show_date) { if (opt_log_show_date) {
snprintf(datetime, sizeof(datetime), "[%d-%02d-%02d %02d:%02d:%02d] ", snprintf(datetime, sizeof(datetime), "[%d-%02d-%02d %02d:%02d:%02d] ",
tm->tm_year + 1900, tm->tm_year + 1900,
tm->tm_mon + 1, tm->tm_mon + 1,
tm->tm_mday, tm->tm_mday,
tm->tm_hour, tm->tm_hour,
tm->tm_min, tm->tm_min,
tm->tm_sec); tm->tm_sec);
} }
else { else {
snprintf(datetime, sizeof(datetime), "[%02d:%02d:%02d] ", snprintf(datetime, sizeof(datetime), "[%02d:%02d:%02d] ",
tm->tm_hour, tm->tm_hour,
tm->tm_min, tm->tm_min,
tm->tm_sec); tm->tm_sec);
} }
/* Only output to stderr if it's not going to the screen as well */ /* Only output to stderr if it's not going to the screen as well */
if (!isatty(fileno((FILE *)stderr))) { if (!isatty(fileno((FILE *)stderr))) {
fprintf(stderr, "%s%s\n", datetime, str); /* atomic write to stderr */ fprintf(stderr, "%s%s\n", datetime, str); /* atomic write to stderr */
fflush(stderr); fflush(stderr);
} }
my_log_curses(prio, datetime, str, force); my_log_curses(prio, datetime, str, force);

View File

@ -9,11 +9,11 @@
#include <syslog.h> #include <syslog.h>
#else #else
enum { enum {
LOG_ERR, LOG_ERR,
LOG_WARNING, LOG_WARNING,
LOG_NOTICE, LOG_NOTICE,
LOG_INFO, LOG_INFO,
LOG_DEBUG, LOG_DEBUG,
}; };
#endif #endif