begin
widget_body=render :inline => widget.java_definition.getTarget().getTemplate(), :locals => {:widget_properties => widget.properties_as_hash, :widget => widget, :dashboard_configuration => @dashboard_configuration}
rescue => error
- logger.error(message('dashboard.cannot_render_widget_x', :params => [widget.java_definition.getId(), error]))
- error.backtrace.each { |line| logger.error(' ' + line) }
+ logger.error(message('dashboard.cannot_render_widget_x', :params => [widget.java_definition.getId(), error]), error)
end
end
begin
widget_body=render :inline => @widget_definition.getTarget().getTemplate(), :locals => {:widget_properties => @widget.properties_as_hash, :widget => @widget, :dashboard_configuration => @dashboard_configuration}
rescue => error
- logger.error(message('dashboard.cannot_render_widget_x', :params => [@widget_definition.getId(), error]))
- error.backtrace.each { |line| logger.error(' ' + line) }
+ logger.error(message('dashboard.cannot_render_widget_x', :params => [@widget_definition.getId(), error]), error)
widget_body=""
end
# - logger key is 'rails'
# - silence is not implemented
# - level FATAL does not exist in SLF4J. It's linked to ERROR level.
+# - progname is an excpetion
#
class Slf4jLogger
def initialize(logger_name='rails')
def debug(message = nil, progname = nil, &block)
@logger.debug(full_message(message, &block))
+ progname.backtrace.each { |line| @logger.debug(' ' + line) } if progname
end
def info(message = nil, progname = nil, &block)
@logger.info(full_message(message, &block))
+ progname.backtrace.each { |line| @logger.info(' ' + line) } if progname
end
def warn(message = nil, progname = nil, &block)
@logger.warn(full_message(message, &block))
+ progname.backtrace.each { |line| @logger.warn(' ' + line) } if progname
end
def error(message = nil, progname = nil, &block)
@logger.error(full_message(message, &block))
+ progname.backtrace.each { |line| @logger.error(' ' + line) } if progname
end
def fatal(message = nil, progname = nil, &block)
@logger.error(full_message(message, &block))
+ progname.backtrace.each { |line| @logger.error(' ' + line) } if progname
end
def flush