   stack.pop()
 
 _treeLine = (prefix, key, strVal, options) ->
-  fnLog = options.log
-  fnLog "#{prefix}#{key}: #{chalk.bold strVal}"
-
+  options.log "#{prefix}#{key}: #{chalk.bold strVal}"
 
 
 #-----------------------------------------------
 #- ### Public API
 #-----------------------------------------------
 module.exports = {
+  mainStory: _createStory(),
 }

# * `obj: object?
_log = (data) ->
  data.t = new Date()
  if not data.msg?
    data.msg = data.src
    data.src = undefined
  else if not _.isString data.msg
    data.obj = data.msg
    data.msg = data.src
    data.src = undefined

  ## TODO
  ## if process.env.NODE_ENV isnt 'production'
  ## convert ansi colors to console.log styles
  console.log arguments
  return

#-----------------------------------------------
# ### Storyboard
#-----------------------------------------------
logger = ->
  api = {tree}
  _.each LEVELS, (levelStr, levelNum) ->
    api[levelStr.toLowerCase()] = (src, msg, obj) -> _log {level: levelNum, src, msg, obj}
  api

# #### tree()
tree = (node, options = {}, prefix = '', stack = []) ->
  options.log ?= _log
  options.ignoreKeys ?= []
  stack.push node
  postponedArrayAttrs = []

  40: 'WARN'
  50: 'ERROR'
  60: 'FATAL'
  70: 'STORY'
# TODO: create inverse map automatically
MAP_LEVELS =
  TRACE: 10
  DEBUG: 20
  INFO: 30
  WARN: 40
  ERROR: 50
  FATAL: 60
  STORY: 70
MAIN_SRC = 'main'
CHILD_TITLE = ''

#-----------------------------------------------
#- ### Helpers
#-----------------------------------------------
# A log message has:
# * `parent: number`
# * `t: date`
# * `level: number`
# * `src: string?`
