I'm trying to debug this code. With this goal, I'm trying to use logging following this tutorial. With this goal, I insert this code in my script:
import logging
logging.basicConfig(level=logging.DEBUG, format='%(asctime)s - %(levelname)s - %(message)s')
logging.debug('This is a log message.')
And, in the section where I wanted to get the message logging, I inserted the line: logging.debug ('This is a log message.')
this way:
def fcount(self,f,cat):
res = db.GqlQuery("SELECT * FROM fc WHERE feature =:feature AND category =:category", feature = f, category = cat).get()
logging.debug('This is a log message.')
# res=self.con.execute(
# 'select count from fc where feature="%s" and category="%s"'
# %(f,cat)).fetchone()
if res is None: return 0
else:
res = fc.count
return float(res)
It turns out that my application is an GAE application. And I cannot see the logging message, which doesn't appear in the browser or in PyScripter IDE. Where should I see the screen with the logging message?
PS - I tried use this code to alternately write logging messages to a file:
import logging
logging.basicConfig(filename='log_filename.txt', level=logging.DEBUG, format='%(asctime)s - %(levelname)s - %(message)s')
logging.debug('This is a log message.')
But I find one I/O error.