Skip to content

Commit

Permalink
Better log formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
rnc committed Feb 6, 2024
1 parent 4a7fc2c commit 085719a
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion docker_squash/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def __init__(self):

self.log = logging.getLogger()
formatter = logging.Formatter(
"%(asctime)s %(name)-12s %(levelname)-8s %(message)s"
"%(asctime)s %(filename)s:%(lineno)-10s %(levelname)-5s %(message)s"
)

handler_out.setFormatter(formatter)
Expand Down
1 change: 0 additions & 1 deletion docker_squash/image.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@


class Chdir(object):

"""Context manager for changing the current working directory"""

def __init__(self, newPath):
Expand Down
4 changes: 3 additions & 1 deletion tests/test_integ_squash.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,9 @@ class IntegSquash(unittest.TestCase):

log = logging.getLogger()
handler = logging.StreamHandler()
formatter = logging.Formatter("%(asctime)s %(name)-12s %(levelname)-8s %(message)s")
formatter = logging.Formatter(
"%(asctime)s %(filename)s:%(lineno)-10s %(levelname)-5s %(message)s"
)
handler.setFormatter(formatter)
log.addHandler(handler)
log.setLevel(logging.DEBUG)
Expand Down

0 comments on commit 085719a

Please sign in to comment.