 
     @disposables.add atom.workspace.observeActivePaneItem (item) =>
       @itemUpdate(item)
+      
+    atom.commands.add 'atom-workspace', 'log:toggle-log-panel', => @toggleLogPanel()
 
   deactivate: ->
     @disposables.dispose()


    @grammarDisposable.add item.observeGrammar? (grammar) =>
      @removeLogPanel()
      @addLogPanel(item) if grammar.name is 'Log'

  addLogPanel: (textEditor) ->
    return unless atom.config.get 'language-log.showFilterBar'

    # Create new log view if opened log differs from previous
    unless @logView?.textEditor is textEditor
      LogView ?= require './log-view'


  removeLogPanel: ->
    @logPanel?.destroy()

  toggleLogPanel: ->
    if @logPanel?
      @removeLogPanel()
    else
      @addLogPanel(atom.workspace.getActiveTextEditor())
