Re: Logging from files doesn't work

2017-10-12 Thread Andrew Z
Cameron, Peter, Thank you. Your comments were spot on. Changing root logger got the logs spitting into the file. And i now can org these logs into one directory, instead of the current mess. Thank you! On Oct 11, 2017 23:41, "Cameron Simpson" wrote: > On 11Oct2017 22:27, Andrew Z wrote: > >>

Re: Logging from files doesn't work

2017-10-12 Thread Peter Otten
Andrew Z wrote: > Hello, > > apparently my reading comprehension is nose diving these days. After > reading python cookbook and a few other tutorials i still can't get a > simple logging from a few files to work. > I suspected my file organization - all files are in the same directory, > causing

Re: Logging from files doesn't work

2017-10-11 Thread Cameron Simpson
On 11Oct2017 22:27, Andrew Z wrote: aha. So the issue is that main.py's __name__ attribute == "__main__" and test.py is "test1.test". Yeah. If you invoke a module as "python -m module_name" its __name__ field is "__main__". That makes the boilerplate work, but breaks your expectation that __

Re: Logging from files doesn't work

2017-10-11 Thread Andrew Z
aha. So the issue is that main.py's __name__ attribute == "__main__" and test.py is "test1.test". if i manually assign names: main.py - > log = logging.getLogger("MAIN") test.py - > log = logging.getLogger("MAIN.test1.test") then logging is working perfectly well. This brings me to the question

Re: Logging from files doesn't work

2017-10-11 Thread Andrew Z
if i change print statements in both files to print out "__name__": __main__ test1.test On Wed, Oct 11, 2017 at 10:02 PM, Andrew Z wrote: > Hello, > > apparently my reading comprehension is nose diving these days. After > reading python cookbook and a few other tutorials i still can't get a > s

Logging from files doesn't work

2017-10-11 Thread Andrew Z
Hello, apparently my reading comprehension is nose diving these days. After reading python cookbook and a few other tutorials i still can't get a simple logging from a few files to work. I suspected my file organization - all files are in the same directory, causing problem. But it appears it is