Skip to content

Commit

Permalink
vasqFork now converts the pid_t to a long instead of an int when logging
Browse files Browse the repository at this point in the history
  • Loading branch information
nickeldan committed Mar 28, 2021
1 parent 4f05095 commit 192ebdf
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions README
Original file line number Diff line number Diff line change
Expand Up @@ -89,11 +89,11 @@ vasqLoggerDataProcessor is defined by
typedef void (*vasqLoggerDataProcessor)(void*, size_t, vasqLogLevel_t, char**, size_t*);

When the logger encounters a %x in the format string, it will call the processor (if it isn't NULL) with
user_data as the first argument, an index as the second, and the log level as the third. The index is a 0-up
counter of which %x in the format string is being handled. The fourth and fifth arguments will be pointers
to the destination and remaining size and function as in vasqIncSnprintf. The processor is responsible for
adjusting these two values (recall that the terminator is not included in the calculation). The processor
can write a terminator at the end but it is not necessary.
user_data as the first argument, an index as the second, and the log level as the third. The index will be a
0-up counter of which %x in the format string is being handled. The fourth and fifth arguments will be
pointers to the destination and remaining size and function as in vasqIncSnprintf. The processor is
responsible for adjusting these two values (recall that the terminator is not included in the calculation).
The processor can write a terminator at the end but it is not necessary.

Here is an example of creation and use of a logger.

Expand Down
2 changes: 1 addition & 1 deletion source/logger.c
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,7 @@ vasqFork(const vasqLogger *logger, const char *file_name, const char *function_n

default:
vasqLogStatement(logger, VASQ_LL_DEBUG, file_name, function_name, line_no,
"Child process started (PID = %i)", child);
"Child process started (PID = %li)", (long)child);
break;
}

Expand Down

0 comments on commit 192ebdf

Please sign in to comment.