Skip to content

Instantly share code, notes, and snippets.

@thewellington
Created September 27, 2013 22:33
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 thewellington/6736166 to your computer and use it in GitHub Desktop.
Save thewellington/6736166 to your computer and use it in GitHub Desktop.
I use this script to log everything I do throughout the day
#!/usr/bin/env python
# myLogger.py by bill@wellingtonnet.net - 2012-11-14
# This module takes additional commandline arguments, concatenates them into a
# string, and then appends that string to a defined output file.
#
# Intended to be an easy to access work log for all things that I have completed
#
# import necessary modules
import sys
import os
import datetime
# main() function
def main():
now = datetime.datetime.now()
tmp = ' '.join(sys.argv[1:])
outfile = '/Users/bwelling/Dropbox/scripts/myLogger/output/done.log'
outstr = now.strftime("%Y-%m-%d %H:%M:%S") + ' - ' + tmp + '\n'
f=open(outfile,'a')
f.write(outstr)
f.close()
# print sys.argv[0:1]
print 'Adding ' + outstr
# Call main()
if __name__ == '__main__':
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment