     add: (type, args = []) ->
       entry = LogEntry.build(type, args)
       @entries.push entry
+      entry_index = @entries.length - 1
 
       if @log_entry_display_types.indexOf(type) != -1
-        @console_log.apply(null, entry.display(@stringify_objects))
+        @console_log.apply(null, entry.display(@stringify_objects, entry_index))
 
     typesForLevel: (level)->
       switch level

          ret.push arg
      ret.push current_str unless current_str.length == 0
      ret
    display: (force_string)->
      if force_string
        [@createStrMsg()]
      else

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

    createArrMsg: (index)->
      ret = []
      current_str = @levelAndEntryIndexString()

      for arg in @args
        if typeof arg is 'string'
          current_str += " #{arg}"
