mirror of
https://github.com/GOSTSec/sgminer
synced 2025-01-31 08:54:19 +00:00
logging spaces/indentation
This commit is contained in:
parent
cbc22823df
commit
6971ce6fe0
38
logging.c
38
logging.c
@ -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);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user