   flushLog()
   return
 
-initialize = ->
+initialize = (e) ->
   dump "initialize."
   readConfig()
   cacheSheetRows()
-  ###
-  SpreadsheetApp.getUi().createAddonMenu()
-  .addItem('Start', 'showSidebar')
-  .addToUi();
-  ###
-  return
-
-#
-#  SpreadsheetApp.getUi().createAddonMenu()
-#  .addItem('Start', 'showSidebar')
-#  .addToUi();
-#
+  initializeMenus e
+  return
+
+initializeMenus = (e) ->
+  namespace = properties.getProperty 'namespace'
+  ui = SpreadsheetApp.getUi()
+  ui.createAddonMenu()
+  .addItem 'Log State', "#{namespace}.logState"
+  .addToUi()
+
 
 ###
 Event handlers

###
Called onOpen
###
onOpen = ->
  dump "onOpen."
  initialize()
  return

edit = (e) ->

    ScriptApp.getProjectTriggers().map (item) ->
      item.getHandlerFunction()
  dump config
  dump properties.getProperty 'namespace'
  flushLog()
  return

