Don't log state changes if nothing user-visible has changed.
This commit is contained in:
parent
f990fc61e0
commit
df9f0fb30a
3 changed files with 12 additions and 5 deletions
4
TODO
4
TODO
|
@ -1,7 +1,5 @@
|
||||||
Core
|
Core
|
||||||
~~~~
|
~~~~
|
||||||
- kernel: persistent mode
|
|
||||||
|
|
||||||
- client: Ctrl-R eats one more enter
|
- client: Ctrl-R eats one more enter
|
||||||
- client: paging?
|
- client: paging?
|
||||||
- client: data losses on large dumps?
|
- client: data losses on large dumps?
|
||||||
|
@ -12,8 +10,6 @@ Core
|
||||||
- bgp: timing of updates?
|
- bgp: timing of updates?
|
||||||
- bgp: dump and get_route_info
|
- bgp: dump and get_route_info
|
||||||
|
|
||||||
- proto: Don't show repeated `Changed state to ...' messages if only internal states change
|
|
||||||
|
|
||||||
Documentation
|
Documentation
|
||||||
~~~~~~~~~~~~~
|
~~~~~~~~~~~~~
|
||||||
- write doctool
|
- write doctool
|
||||||
|
|
10
nest/proto.c
10
nest/proto.c
|
@ -59,7 +59,17 @@ proto_relink(struct proto *p)
|
||||||
{
|
{
|
||||||
list *l;
|
list *l;
|
||||||
|
|
||||||
|
if (p->debug & D_STATES)
|
||||||
|
{
|
||||||
|
char *name = proto_state_name(p);
|
||||||
|
if (name != p->last_state_name_announced)
|
||||||
|
{
|
||||||
|
p->last_state_name_announced = name;
|
||||||
PD(p, "State changed to %s", proto_state_name(p));
|
PD(p, "State changed to %s", proto_state_name(p));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
p->last_state_name_announced = NULL;
|
||||||
rem_node(&p->n);
|
rem_node(&p->n);
|
||||||
switch (p->core_state)
|
switch (p->core_state)
|
||||||
{
|
{
|
||||||
|
|
|
@ -107,6 +107,7 @@ struct proto {
|
||||||
unsigned reconfiguring; /* We're shutting down due to reconfiguration */
|
unsigned reconfiguring; /* We're shutting down due to reconfiguration */
|
||||||
u32 hash_key; /* Random key used for hashing of neighbors */
|
u32 hash_key; /* Random key used for hashing of neighbors */
|
||||||
bird_clock_t last_state_change; /* Time of last state transition */
|
bird_clock_t last_state_change; /* Time of last state transition */
|
||||||
|
char *last_state_name_announced; /* Last state name we've announced to the user */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* General protocol hooks:
|
* General protocol hooks:
|
||||||
|
|
Loading…
Reference in a new issue