Commit Graph

15 Commits (reverse-scroll)

Author SHA1 Message Date
nirenjan cf89e3d610 Override `time` from libc
Prior to this change, there were spurious build failures seen in Github
CI, especially on macOS builds, where one test out of ~2000 would fail
randomly. After adding an option to display the diagnostics, it was
determined that the failure was only in the tests that included the
timestamp. This was because the time call was returning different values
between `test_setup` and `pinelog_log_message`. Even though they may
have been called milliseconds apart, the time skew was enough to have a
1 second difference between the two returned values.

This change overrides the `time` method from libc, and returns a static
value. With this change, CI should work fine regardless of how slow the
tests run.
2021-11-11 07:02:21 -08:00
nirenjan e9d4e81a4d Display TAP diagnostics in build log 2021-11-11 06:21:20 -08:00
nirenjan f4a8e7c4d5 Do not print NULL module names
Prior to this change, if a module had not registered a name, then the
output would display `(null): `, which was not really helpful. This
change eliminates that by checking if the module name is not NULL prior
to calling the print routines.
2021-11-10 09:27:40 -08:00
nirenjan 86f599fc6e Update logging library to include module and string buffer
This commit adds the following changes to pinelog:

- Optional buffer to write the message to prior to writing to the output
  stream. This reduces the likelihood of log messages from multiple
  threads interleaving due to multiple calls to fputs/fprintf, etc. The
  default is to still write directly to the output stream, but the
  integrator can add a define of PINELOG_BUFFER_SZ to the CFLAGS, and
  this will allow the application to log messages that are shorter than
  the above size, including the timestamp, level and backtrace if any.

- Optional module level logging. This allows more fine-grained
  debugging, where the application can control the log levels of the
  individual modules. By default, when modules are configured, they
  default to the global log level, but this can be overridden by the
  application.
2021-11-08 16:18:30 -08:00
nirenjan 6d78ab1940 Add noreturn attribute to tap_bailout
This change is necessary since clang warns on a missing noreturn
attribute.
2021-10-25 12:56:41 -07:00
nirenjan 3c006d0929 Merge commit '6c17e73284fbe49a6bc7890d3e221b95db29d56f' 2021-10-25 12:51:04 -07:00
nirenjan 52d6920352 Merge commit '4c9ef85223ec6e638976eb279b82b9e9ea676b35' 2021-08-25 14:22:04 -07:00
nirenjan d9c1c80163 Merge commit 'dc72e43f1e43a0149c48a684d3b5fd40441ef83c' 2021-08-03 11:26:06 -07:00
nirenjan 7a4d63adc1 Merge commit '8db1be2ba8dc66d3abf69a8360990c659bf28f16' into daemon 2021-07-27 17:02:49 -07:00
nirenjan e54f6037d4 Fix pinelog builds on MacOS 2021-07-19 11:15:42 -07:00
nirenjan 3a68148472 Merge commit '9fa1a428a45eabff0122e199a687068f0e6280dd' into daemon 2021-07-19 09:50:42 -07:00
nirenjan 27eb123062 Update README to include destructor attribute 2021-07-16 08:33:22 -07:00
nirenjan 0d407d77fe Add method to close output stream and reset to default 2021-07-16 08:29:11 -07:00
nirenjan e32f836485 Fix format-literal error in clang 2021-07-15 18:31:01 -07:00
nirenjan fd79166a89 Merge commit '50dc946c3177f5006e4bd63eef4bf67331f59dea' as 'lib/pinelog' 2021-07-14 15:54:58 -07:00