[lxc-devel] Duplicate definitions of `lxc_log_define`
Cedric Le Goater
legoater at free.fr
Mon Jan 11 09:43:05 UTC 2010
On 01/10/2010 04:29 AM, Daniel Lezcano wrote:
>> Now I assume that when dynamically linking the executables no
>> > conflict is found, but when statically linking them I get multiple
>> > definitions errors.
>> >
>> > I've fixed this by adding a `_` at the end of the name in the
>> > `lxc_*.c` files, like: `lxc_log_define(lxc_start_, lxc);`
>> >
>> > So if anyone has time to look this up would be nice.
yes. it's a bug. the .c files containing the main() routine should not use
the same log category used in the associated function.
> It would be simple to define lxc_log_define(start, lxc) for start.c and
> lxc_log_define(lxc_start, lxc) for lxc_start.c and so on for the rest of
> the lxc_log_define eg. lxc_log_define(lxc_namespace, lxc) =>
> lxc_log_define(namespace, lxc).
what you propose should be fine but it kind of messes up the hierarchy concept
which is behind the log4* names to activate or deactivate a branch of categories.
if we were to respect this hierarchy concept, we would use something like :
lxc_log_define(lxc_start, lxc) for lxc_start.c
lxc_log_define(lxc_start_routine, lxc_start) for start.c
ideally, the command line interface should only use fprintf(stderr). I think
it's better to work in that direction.
C.
More information about the lxc-devel
mailing list