Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Generate reports of time spent in your editor
Haskell
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
doc
scripts
src
.gitignore
EditTimeReport.cabal
LICENSE
README
TODO

README

Edit Time Report
----------------

  Logging the times of edits can give you a pretty good overview of 
  the work you've done in the past and opens the data up for analysis.
  Edit Time Report is a set of tools ('report', 'editlogd' and 'editlog')
  that help with logging, querying and generating reports in plain text, 
  html, xhtml or csv format.

  Using this tools, you will be able to answer questions like:

     * How many hours did I spent working on a language/project/file?
     * What language have I used the most this year?
     * What's my most productive day of the week?
     * How much time did I work on year/month/week/day?
     * ..and on which project or language?


Logging
-------
  
  To be able to make logging easy and editor-agnostic we use a simple 
  daemon and client architecture (you could also let your editor 
  write the logs directly if you want).
 
  The daemon `editlogd' is an Haskell program that logs to a flat plain 
  text file in the following format:

     YEAR MONTH DAY HOUR MIN SEC DOW DOY COMMAND FILE
     2009 12 29 10 39 23 1 363 EDIT /home/bspaans/src/file.hs

     where DOW and DOY resp. stand for the day of the week (0 is sunday)
     and year, and where COMMAND is one of EDIT, NEW, START or STOP. 

  The client `editlog' is a simple bash script that contacts the daemon 
  when executed and should be called from your editor. 


Generating Reports
------------------

  The reporting program is also written in Haskell. It can parse the log file, 
  do some analysis (like project and language classification) and produce 
  HTML, XHTML, csv and plain text output.

  To create reports you can use a tiny DSL to query the data. For some usage 
  examples and the grammar, you should check out the wiki.


Installing
----------

  Compiling the tool-set is easy if you have cabal:

    cabal install

  Alternatively, you could install the program manually if you have all
  the dependencies (see EditTimeReport.cabal):
 
    alex QueryLexer.x
    happy QueryParser.y
    ghc --make Main.hs 
    ghc --make Daemon.hs

  Next, you need to make sure the daemon is started when you login. 
  There are several ways to do this, some dependent of 
  window managers, but that should be easy enough to find out. 

  The command to be started on login should read like this:

      editlogd /path/to/log/file

  The path can be used to specify the location of the logfile. 
  If left blank ~/report.log will be used.

  Now the only thing that remains is to set up your editor hooks.


Editor Hooks :: vim
-------------------

    Put the following in your ~/.vimrc:

    " chart functionality
    autocmd VimEnter * :silent ! editlog -s
    autocmd VimLeave * :silent ! editlog -e
    autocmd BufNewFile * :silent ! editlog -n <afile>:p
    autocmd BufWritePost * :silent ! editlog -w <afile>:p

Editor Hooks :: emacs
---------------------

    TODO
Something went wrong with that request. Please try again.