diff options
| author | Sebastiano Tronto <sebastiano@tronto.net> | 2025-04-15 15:51:40 +0200 |
|---|---|---|
| committer | Sebastiano Tronto <sebastiano@tronto.net> | 2025-04-15 15:51:40 +0200 |
| commit | b25a939e2d8b045c083caf3264c4e5aac1cf88fb (patch) | |
| tree | 37b862c82389ceddcf4624b5e26536390d6b8265 /test/test.h | |
| parent | b02c083a3545b6e6b36ab62680128edec619a804 (diff) | |
| download | nissy-core-b25a939e2d8b045c083caf3264c4e5aac1cf88fb.tar.gz nissy-core-b25a939e2d8b045c083caf3264c4e5aac1cf88fb.zip | |
Better logging function
Now it is possible to provide some data together with the logging function.
This is useful for example in C++, where I can now provide an arbitrary
callable object as data, and a simple wrapper function that call the
callable object as logging function.
Diffstat (limited to 'test/test.h')
| -rw-r--r-- | test/test.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/test/test.h b/test/test.h index 0b12fb7..97f229b 100644 --- a/test/test.h +++ b/test/test.h | |||
| @@ -31,13 +31,13 @@ int64_t writecube(const char *, cube_t, size_t n, char [n]); | |||
| 31 | /* Test function to be implemented by all tests */ | 31 | /* Test function to be implemented by all tests */ |
| 32 | void run(void); | 32 | void run(void); |
| 33 | 33 | ||
| 34 | void log_stderr(const char *str) | 34 | void log_stderr(const char *str, void *unused) |
| 35 | { | 35 | { |
| 36 | fprintf(stderr, "%s", str); | 36 | fprintf(stderr, "%s", str); |
| 37 | } | 37 | } |
| 38 | 38 | ||
| 39 | int main(void) { | 39 | int main(void) { |
| 40 | nissy_setlogger(log_stderr); | 40 | nissy_setlogger(log_stderr, NULL); |
| 41 | run(); | 41 | run(); |
| 42 | return 0; | 42 | return 0; |
| 43 | } | 43 | } |
