 ttm.define "logger", ['lib/class_mixer'], (class_mixer)->
   class LogEntry
     initialize: ((@level, @args)->)
-    createStrMsg: ->
+    createStrMsg: (index)->
       message = ''
       for arg in @args
         arg = JSON.stringify(arg) unless typeof arg is 'string'
         message += "#{arg} "
-      "#{@level}: #{message}"
+      "#{@levelAndEntryIndexString()} #{message}"
 
-    createArrMsg: ->
+    createArrMsg: (index)->
       ret = []
-      current_str = "#{@level}: "
+      current_str = @levelAndEntryIndexString()
+
       for arg in @args
         if typeof arg is 'string'
           current_str += " #{arg}"

    instrument: (opts)->
      __logger = @
      ->
        arr = Array.prototype.slice.call(arguments)
        arr.unshift(@)
        arr.unshift "#{opts.name} call: "
        __logger.add('instrumented', arr)
        retval = opts.fn.apply(@, arguments)
        __logger.add('instrumented', ["#{opts.name} return: ", retval])
        retval

  class_mixer Logger


      @log_entry_types = ['error','warn','info','debug', 'log', 'instrumented']

      @log_entry_display_types = @typesForLevel(opts.log_level || 'production')
      @console_log = opts.console_log
      @stringify_objects = opts.stringify_objects
      @entries = []
