Skip to content

Instantly share code, notes, and snippets.

@lotabout
Created May 2, 2018 05:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lotabout/d9ada5f683a9084887f1e55a8434fa9c to your computer and use it in GitHub Desktop.
Save lotabout/d9ada5f683a9084887f1e55a8434fa9c to your computer and use it in GitHub Desktop.
Add timestamp to log
#!/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