rser.ConfigParser()
if args.config_file is None:
config_file = DEFAULT_CONFIG_FILE
else:
config_file = args.config_file
config.read(config_file)
logging.config.fileConfig(fname=config_file)
logger = logging.getLogger(_
config_file = args.config_file
>>>config.read(config_file)
>>>logging.config.fileConfig(fname=config_file)
>>>logger = logging.getLogger(__name__)
>>>do_some_stuff()
>>> my_class_instance = myprog.MyClass()
args = parser.parse_args()
>>config = configparser.ConfigParser()
>>if args.config_file is None:
>>config_file = DEFAULT_CONFIG_FILE
>>else:
>>config_file = args.config_file
>>config.read(config_file)
>>
Peter Otten <__pete...@web.de> writes:
> On 31/03/2023 15:01, Loris Bennett wrote:
[snip (53 lines)]
> Your problem has nothing to do with logging -- it's about visibility
> ("scope") of names:
>
def use_name():
> print(name)
>
>
def define_name():
> name = "Loris"
>
>
if args.config_file is None:
config_file = DEFAULT_CONFIG_FILE
else:
config_file = args.config_file
config.read(config_file)
logging.config.fileConfig(fname=config_file)
logger = logging.getLogger(__name__)
do_some_stuff()
my_clas
if args.config_file is None:
config_file = DEFAULT_CONFIG_FILE
else:
config_file = args.config_file
config.read(config_file)
logging.config.fileConfig(fname=config_file)
logger = logging.getLogger(__name__)
do_some_stuff()
my_clas
onfig_file = DEFAULT_CONFIG_FILE
else:
config_file = args.config_file
config.read(config_file)
logging.config.fileConfig(fname=config_file)
logger = logging.getLogger(__name__)
do_some_stuff()
my_class_instance = myprog.MyClass()
def do_
Ram writes:
> How does this line work?
What line? Please present some code in an example that we can run. Make
the example as small as possible so it's clear what you are asking about.
--
\ “See, in my line of work you gotta keep repeating things over |
`\ and over and over agai
How does this line work? How do I get my logger to point to a file to
be named as /tmp/modulename.log : I can do this using inspect, but
there probably is a better way?
Thanks,
--Ram
--
http://mail.python.org/mailman/listinfo/python-list
On 6/15/10 9:03 AM, genkuro wrote:
> I'm coming to Python from Java. I'm still getting a feel for scoping
> limits. For the sake of curiosity, is there another way to refer to a
> package besides name?
The only way to refer to anything is by its name -- or, from a name and
through subscript/dot
On 15/06/2010 17:03, genkuro wrote:
On Jun 15, 8:49 am, Mark Lawrence wrote:
On 15/06/2010 16:35, genkuro wrote:
Newbie here. I may be missing something obvious, in which case,
please feel free to berate and laugh at me.
Here's a dubious line of code:
logging = logging.getLogger(__n
genkuro wrote:
On Jun 15, 8:49 am, Mark Lawrence wrote:
On 15/06/2010 16:35, genkuro wrote:
Newbie here. I may be missing something obvious, in which case,
please feel free to berate and laugh at me.
Here's a dubious line of code:
logging = logging.getLogger(__n
genkuro wrote:
Newbie here. I may be missing something obvious, in which case,
please feel free to berate and laugh at me.
Here's a dubious line of code:
logging = logging.getLogger(__name__)
How can I refer to the original logging package "logging" after this
statement is run
On Jun 15, 8:49 am, Mark Lawrence wrote:
> On 15/06/2010 16:35, genkuro wrote:
>
> > Newbie here. I may be missing something obvious, in which case,
> > please feel free to berate and laugh at me.
>
> > Here's a dubious line of code:
> > logging = loggi
Peter Otten <__pete...@web.de> writes:
> genkuro wrote:
>
>> Newbie here. I may be missing something obvious, in which case,
>> please feel free to berate and laugh at me.
>>
>> Here's a dubious line of code:
>> logging = logging.getLogger(__name
genkuro wrote:
> Newbie here. I may be missing something obvious, in which case,
> please feel free to berate and laugh at me.
>
> Here's a dubious line of code:
> logging = logging.getLogger(__name__)
Dubious indeed. As a workaround you can import the module again, prefe
On 15/06/2010 16:35, genkuro wrote:
Newbie here. I may be missing something obvious, in which case,
please feel free to berate and laugh at me.
Here's a dubious line of code:
logging = logging.getLogger(__name__)
How can I refer to the original logging package "logging" after
Newbie here. I may be missing something obvious, in which case,
please feel free to berate and laugh at me.
Here's a dubious line of code:
logging = logging.getLogger(__name__)
How can I refer to the original logging package "logging" after this
statement is run? Specifically
18 matches
Mail list logo