3 ms·
I once wrote a simple python program that logged all execution, self inspected code and printed code and variables as output. Then I learned why programs don't
by TZubiri 1y ago
I once wrote a simple python program that logged all execution, self inspected code and printed code and variables as output.
Then I learned why programs don't do that by default.
Not to be snarky, but when you become more experienced you will figure out that logging is just writing to permanent storage, one of the most basic blocks of programming, you don't need a dependency for that, writing to disk should be as natural as breathing air, you can do print("var",var). That's it.
If you are really anal you can force writing to a file with a print argument or just a posix open and write call. No magic, no remembering, no blogpost. Just done, and next.