Hi Martin! How are you? Here in Madrid very, very hot! we need more swimming pools :)!
Do you mean the log messages with class <DBG> or just messages logged through the debug() function?
Any of them. The only thing I need is to know what is happening inside the program (for example, if the program is parsing attributes, which attribute is being encoding, or if the program is entering in a determined switch-case, etc) at running time. The log messages with class <DBG> would be perfect because it offers practically all the information I need. But I can't see them. You said that the <DBG> class is used very rarely. Does it mean that they can't be forced to appears in the log file? How can I see them? The debug() function, which I didn't discovered:-), would be also OK, but if I simply use it in attrs.c (the file I am working on), bird returns me a syntaxt error when making. What do I need to include in attrs.c in order to make debug() works? perhaps birdlib.h, where it is declared? or copy it definition from sysdep/unix/log.c? In sysdep/unix/log.c I have also discovered the log_msg() function. I think it works in a very similar way to the debug() function, but I have the same questions for that. About the BGP_TRACE() function, I was analycing it code, and I realise that the problem when using it in the bgp_encode_attrs() function is that BGP_TRACE() needs that the function from you are calling it, have "sock *sk" as argument, in order to get from sk the struct bgp_proto *p by: struct bgp_conn *conn = sk->data; struct bgp_proto *p = conn->bgp; As the bgp_encode_attrs() function doesn't have "sock *sk" as argument, I can't use BGP_TRACE inside it :(. I considered adding this argument to bgp_encode_attrs, and try to work in this way, but I think is more complicated that using the other option I explained above. What do you think about that? I feel I'm founding too many problems only whith getting the information messages... Thanks a lot Martin. Best regards, Jorge <jorge1981@gmail.com> 2006/8/7, Martin Mares <mj@ucw.cz>:
Hi!
Yes, that's what I mostly got in my log file. But the <DBG> messages show a lot of information very intersting for me about the internal procedures of BIRD. Is there any way of getting them in my log file? or is it completely impossible?
Do you mean the log messages with class <DBG> or just messages logged through the debug() function?
The former should be a part of the log file, the latter can be directed into any file you like by the -D switch.
I would like to get messages with values of variables while running, or at least, messages in the log file to know if the program enters into a certain switch-case, and that kind of things. I tried with the BGP_TRACE(D_PACKETS, "hello") function in attrs.c (the file which i am mostly working on), but it crash when I execute "make". It seems like if it is not declared, or something like that. Can you tell me where is the BGP_TRACE declaration, in order to undertand it?
It's defined in proto/bgp/bgp.h.
Have a nice fortnight -- Martin `MJ' Mares <mj@ucw.cz> http://atrey.karlin.mff.cuni.cz/~mj/ Faculty of Math and Physics, Charles University, Prague, Czech Rep., Earth
Noli tangere fila metalica, ne in solum incasa quidem.
-- Un saludo, Jorge.