[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
000 "westnet-eastnet":
192.0.1.0/24===192.1.2.45<192.1.2.45>[@west]...192.1.2.23<192.1.2.23>[@east]===192.0.2.0/24;
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 :-(

Andrew


More information about the Swan-dev mailing list