Re: [pygccxml-development] How to customize log messages?
Brought to you by:
mbaas,
roman_yakovenko
|
From: Roman Y. <rom...@gm...> - 2006-04-21 12:45:14
|
On 4/20/06, Matthias Baas <ba...@ir...> wrote:
> Roman Yakovenko wrote:
> > Okay, I was not clear. _logging_ module solves 2 technical problems:
> > 1. I want some module/package that will be independent on all other pac=
kages,
> > because I want to use it in every ( well almost every other ) modul=
e within
> > pyplusplus
>
> This requirement is already met by the standard logging module, isn't it?
> The standard logging module appears to be even better suited because it
> is even independent on pyplusplus whereas _logging_ is part of
> pyplusplus and cannot be used by pygccxml.
pygccxml should have it's own logger. pyplusplus package can re-configure i=
t
to use it's logger.
> > 2. I want to keep code that configure the loggers in one place.
>
> Granted. But your requirement doesn't specify where this place should be
> located, so this point would also be met if you put the configuration in
> the main __init__.py file, for example.
Okay, but how I will write to it?
import logging
logging.debug( '...' )
In this case, if I understand right the logging package and documentation,
it will write message to all loggers. This is definitely not what I want.
or may be
import logging
logging.getLogger( 'pyplusplus' ).debug('...')
In this case I should write more code and I have a chance to misspell
logger name.
> >> what does pygccxml use for writing log messages?.
> >
> > 1. Command line used to run GCC-XML.
> > 2. Report different stage: compile, link
>
> Sorry, my question was not what messages does pygccxml output but what
> mechanism does it use to output the messages? (because it cannot use the
> _logging_ module as this one is part of pyplusplus and pygccxml is
> supposed to be independent of pyplusplus)
Matthias, may be I can not explain my self or I don't understand you.
Both projects use Python logging module, I am not going to reinvent the whe=
el!
py++ creates/configures logger in _logging_ package, while pygccxml in
utils package.
If I rename _logging_ package to log_config or something else, will it be c=
lear?
> - Matthias -
--
Roman Yakovenko
C++ Python language binding
http://www.language-binding.net/
|