[Tutor] Python 3.5 console logging

Cameron Simpson cs at zip.com.au
Tue Dec 1 02:33:34 EST 2015


On 30Nov2015 16:50, Tyler Smithers <tsmithers731 at gmail.com> wrote:
>I am doing a project for my school and i am trying to find out how to make
>a event log. But every where i look all it has is just making a text
>document and it having in their what they put in their script.

That is normally what an event log it; a text file recording significant 
events. This can be done simply with print() calls or more elaborately via the 
logging module.

>But i cant
>find out how to code python into recording everything that happens when i
>run the program. And can you please help me soon because i don't have much
>time. Thank you!

When you say everything, what do you mean? Normally people don't want that 
("everything" might mean every python code line traversed, or every internal 
python opcode executed, etc). Normally that is an insane amount of details, and 
people normally just want to know significant events (user logged in, did this, 
was refused that, files opened/closed or stuff like that).

You'll need to elaborate a bit more on what you're trying to achieve here.

Cheers,
Cameron Simpson <cs at zip.com.au>


More information about the Tutor mailing list