Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
libflux/flog: minor fixes and cleanup #1939
This PR drops a logging option FLUX_LOG_CHECK, which makes
Finally, ensure that
Problem: flux-logger is using the FLUX_LOG_CHECK option presumably just for the benefit of a sharness security test, which has been reworked not to need it. Drop the use of this flag.
Problem: FLUX_LOG_CHECK option for logging with a synchronous RPC is no longer needed. Drop this option.
Problem: security sharness assumes flux-logger fails with EPERM for non instance owner, but this depends on the FLUX_LOG_CHECK flag which is going away. Alter the test to check if the proposed log message is present in the ring buffer using flux dmesg, rather than checking that the flux logger command itself failed. Also some minor clenaup: - drop trailing whitespace - drop extraneous MSG definition in dmesg security test
Problem: flux_log() calls flux_rpc(FLUX_RPC_NORESPONSE), which creates a future that is immediately destroyed. To make logging a bit more lightweight, simply allocate a request message and send it.
Problem: flux_log() is documented to return -1 or 0, but when h=NULL, it returns the number of characters printed. Ensure it returns 0 on success in all cases.
Problem: unit test doesn't call flux_log with flux_t handle set to NULL, but code exists to direct the log to stderr when there is no broker connection. Add a test case for this.
@@ Coverage Diff @@ ## master #1939 +/- ## ========================================== - Coverage 80.1% 80.07% -0.04% ========================================== Files 195 195 Lines 35066 35059 -7 ========================================== - Hits 28091 28074 -17 - Misses 6975 6985 +10