Module: Sinatra::Logentries

Defined in:
lib/sinatra-logentries.rb,
lib/sinatra-logentries/version.rb

Defined Under Namespace

Modules: Helpers

Constant Summary collapse

VERSION =
"0.0.2"
@@logger =
nil
@@token =
''

Class Method Summary collapse

Class Method Details

.loggerObject



25
26
27
28
29
30
31
32
33
# File 'lib/sinatra-logentries.rb', line 25

def self.logger
  @@logger ||= lambda {
    if Sinatra::Application.environment == :production
      @@logger = Le.new(@@token)
    else
      @@logger = Le.new(@@token, true)
    end
  }.call
end

.registered(app) ⇒ Object



35
36
37
# File 'lib/sinatra-logentries.rb', line 35

def self.registered(app)
  app.helpers Logentries::Helpers
end

.token=(token) ⇒ Object



21
22
23
# File 'lib/sinatra-logentries.rb', line 21

def self.token=(token)
  @@token = token
end