gparser.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(__name__)
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.My
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"
>
>
nfigParser()
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
nfigParser()
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 mobilebacku...@gmail.com 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 |
`\
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
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, I'm trying to add
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 this
statement
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, preferably
under another name
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__)
Dubious indeed. As a workaround you can import the module
On Jun 15, 8:49 am, Mark Lawrence breamore...@yahoo.co.uk 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(__name__)
How
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? Specifically
= logging.getLogger(__name__)
How can I refer to the original logging package logging after this
statement is run? Specifically, I'm trying to add a log handler with
logging.addHandler(x) and it is of course failing.
Thanks,
Brian
Change it to something like logger = logging.getLogger
= logging.getLogger(__name__)
How can I refer to the original logging package logging after this
statement is run? Specifically, I'm trying to add a log handler with
logging.addHandler(x) and it is of course failing.
Thanks,
Brian
Change it to something like logger = logging.getLogger(__name__
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
18 matches
Mail list logo