Created
May 2, 2018 05:10
-
-
Save lotabout/d9ada5f683a9084887f1e55a8434fa9c to your computer and use it in GitHub Desktop.
Add timestamp to log
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
# -*- coding: utf-8 -*- | |
from datetime import datetime | |
import fileinput | |
for line in fileinput.input(): | |
print(f'[{datetime.now()}] {line}', end='') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment