[Ns-developers] [ns3] logging proposal
Mathieu Lacage
mathieu.lacage at sophia.inria.fr
Mon Apr 14 16:31:10 PDT 2008
On Tue, 2008-04-15 at 00:20 +0100, Gustavo Carneiro wrote:
> 2. When I specify NS_LOG=Component and nothing more then it should
> be equivalent to NS_LOG=Component=level_all. That's what most people
> use anyway, I'll bet.
If you do that, you will get two outputs for each function where you
have defined NS_LOG_FUNCTION and NS_LOG_PARAMS which is really ugly.
Maybe a simple fix would be to make NS_LOG_FUNCTION not output anything
is LOG_PARAM is set.
> 3. On unix systems, separating NS_LOG components by semicolon is a
> PITA, because it makes me keep quoting the NS_LOG value. It should be
> colon separated on unix systems, semicolon on win32.
Using a different syntax on different platforms is just plain braindead:
just use a colon everywhere and be done with it.
>
> 4. Timestamps logging should not need to be manually configured. I
> would propose one of two ways to accomplish that:
> a) enable timestamps for all log messages unconditionally;
I would be fine with doing this for the NS_LOG=component syntax.
[snip]
> I don't blame you for removing these since they required too much
> typing and programmers were too lazy to use them (myself included).
> But the fact is that I just realized that NS_LOG_PARAMS(foo << bar)
> does not in fact log "(foo=value1, bar=value2)", it just logs the
> values. I would love to see the parameter names in addition to values
yes.
> in all log messages, but, alas, too much typing required by the
> existing NS_LOG_PARAMS_BEGIN/END macros just renders this useless :(
>
> Does anyone knows about variadic macros?... ;-)
highly unportable, unfortunately :/
Mathieu
More information about the Ns-developers
mailing list