Simple TimeStamp Logging Utility

Someone on the AnandTech forums requested an example of how to do this, so here it is.

This program receives two inputs at the command line. The first is a path to store a log. The second is the command line string to execute. Then, the program will pipe all the console output to a file named as the current timestamp in YYMMDD_hhmmss format.

 

For example, if we wanted to log the following command:

dir /O

We'd instead enter the following into the command line:

TimeStampLogger c:\logs\ dir /O

Then it'll pipe the command "dir /O" into a text file in the c:\logs directory. The name of the file will be the system's current time in the above mentioned format with a ".txt" file extension.

This has been compiled with MinGW under Microsoft Windows Vista 64 bit. Some slight modification may be necessary for this program to compile and/or function under a different compiler and/or operating system.

  • Synergy I'm extremely enthused about Synergy - Plant High School's first ever indoor percussion ensemble....
  • Marcato 2011 - In Pieces Marcato Independent is entering its second year in existence. Their 2011 show, In Pieces, is taking...
  • Depth I'm excited to be on the Depth development team. Depth is an aquatic stealth combat game, where divers...
  • Paranormal Entertainment - Overwatch   I'm pleased to announce that I have been recruited by Paranormal Entertainment for a programming...
  • Marcato. Independent. Indoor. Percussion. I'm honored and pleased to announce that I will be on staff for Marcato Independent's inaugural indoor...
  • 1
  • 2