Skip to content

Commit

Permalink
Fix months
Browse files Browse the repository at this point in the history
Signed-off-by: Cervenka Dusan <cervenka@acrios.com>
  • Loading branch information
Hadatko committed May 30, 2023
1 parent 90a09dd commit 40aa987
Showing 1 changed file with 5 additions and 19 deletions.
24 changes: 5 additions & 19 deletions cLog.c
Original file line number Diff line number Diff line change
Expand Up @@ -59,31 +59,17 @@ void cLog_print(const CLogger_t *logger,
time(&timer);
tm_info = localtime(&timer);
# ifdef CLOG_PRINT_DETAILS_FILENAME_TYPE
const char *fName = NULL;

# ifdef __FILENAME__
fName = fileName;
# else
if (fName == NULL)
{
fName = fileName;
}
else
{
fName = &(fName[1]);
}
# endif
# endif
# if defined(CLOG_PRINT_DETAILS_FILENAME_TYPE) && defined(CLOG_PRINT_DETAILS_LINENUMBER_TYPE)
printf("\r\n%04d.%02d.%02d %02d:%02d:%02d>%s%s%s>%s>%s>%d:", 1900 + tm_info->tm_year, tm_info->tm_mon,
printf("\r\n%04d.%02d.%02d %02d:%02d:%02d>%s%s%s>%s>%s>%d:", (1900 + tm_info->tm_year), (tm_info->tm_mon + 1),
tm_info->tm_mday, tm_info->tm_hour, tm_info->tm_min, tm_info->tm_sec, colour, level,
s_cLogLevelToColors[CLOG_VAL_NONE], logger->logName, fName, lineNumber);
s_cLogLevelToColors[CLOG_VAL_NONE], logger->logName, fileName, lineNumber);
# elif defined(CLOG_PRINT_DETAILS_FILENAME_TYPE)
printf("\r\n%04d.%02d.%02d %02d:%02d:%02d>%s%s%s>%s>%s:", 1900 + tm_info->tm_year, tm_info->tm_mon,
printf("\r\n%04d.%02d.%02d %02d:%02d:%02d>%s%s%s>%s>%s:", (1900 + tm_info->tm_year), (tm_info->tm_mon + 1),
tm_info->tm_mday, tm_info->tm_hour, tm_info->tm_min, tm_info->tm_sec, colour, level,
s_cLogLevelToColors[CLOG_VAL_NONE], logger->logName, fName);
s_cLogLevelToColors[CLOG_VAL_NONE], logger->logName, fileName);
# else
printf("\r\n%04d.%02d.%02d %02d:%02d:%02d>%s%s%s>%s>%d:", 1900 + tm_info->tm_year, tm_info->tm_mon,
printf("\r\n%04d.%02d.%02d %02d:%02d:%02d>%s%s%s>%s>%d:", (1900 + tm_info->tm_year), (tm_info->tm_mon + 1),
tm_info->tm_mday, tm_info->tm_hour, tm_info->tm_min, tm_info->tm_sec, colour, level,
s_cLogLevelToColors[CLOG_VAL_NONE], logger->logName, lineNumber);
# endif
Expand Down

0 comments on commit 40aa987

Please sign in to comment.