Add and use a Logger class. Add __main__ check.
Update comment