[Swan-dev] heads up: whack_log(RC, FMT, ...) no longer automagically adds a context prefix

Andrew Cagney andrew.cagney at gmail.com
Tue Dec 10 17:10:10 UTC 2019

such as '"westnet-eastnet" #1: '.  This is because no calls to
whack_log() need it, and the code in whack_log() accessing the globals
cur_{from,connection,state} is being removed (ya).
Instead, with whack_log(), what you see is what you get vis:

000 Connection list:
000 "westnet-eastnet":<>[@west]...<>[@east]===;
unrouted; eroute owner: #0

If you really really really really want your code to emit whack-only
output that includes a context prefix then it can use
log_{state,connection,md}() and specify the context explicitly.
However, I'm highly skeptical towards the correctness of such code -
whack commands other than the likes of "show" and "list" need to leave
breadcrumbs in the log file.

One thing worth pointing out is that whack_log() is still using the
global whack_log_fd :-(


More information about the Swan-dev mailing list