ruby - How to access Sinatra Logger from a model? -


within request, sinatra logger works fine:

get '/'   logger.info "loading data"   ... 

however, within model, doesn't work. model not have access logger:

class foo   def self.do_something     logger.info "loading data"   end end  '/'   foo.do_something   ... 

how access logger within model?

seems want do

class foo < sinatra::base 

because logger not available in scope of foo class defined it.


Comments

Popular posts from this blog

matlab - How to equate a structure array to structure array -

c# - Operator '==' incompatible with operand types 'Guid' and 'Guid' using DynamicExpression.ParseLambda<T, bool> -