CensoredUsername / unrpyc

A ren'py script decompiler
Other
859 stars 156 forks source link

Interleaved output when multiprocessing is used. #206

Closed CensoredUsername closed 5 months ago

CensoredUsername commented 6 months ago

Right now, we protect individual print's from getting interleaved in the output with printlock, but multiple prints after each other (for instance, the one that states which file is being processed) and any warnings afterwards still get scrambled.

It's likely better to go away from the printlock approach, and instead pass any warnings into a logger object that's passed to each each decompiler call, and whose output is then printed in order by the main thread once they finish.

madeddy commented 6 months ago

As i scraped the net for solutions for the sync problem with the result dict, i came across ways which used multiprocess logging and thought about using this. In the end i wasn't sure if you would go for such a big change and searched for other ways.

That said, I'm for it. This would give imo additional advantages like easy logging on different levels, prefixed prints and even color coding. This sounds maybe like fancy nonsense, but is imho useful to visualize whats important, what just info etc. Also, how do you feel about writing certain infos permanent to a "unrpyc.log" file?

CensoredUsername commented 5 months ago

Fixed by #219