lib/openwfe/logging.rb in openwferu-0.9.16 vs lib/openwfe/logging.rb in openwferu-0.9.17
- old
+ new
@@ -1,8 +1,8 @@
#
#--
-# Copyright (c) 2006-2007, John Mettraux, OpenWFE.org
+# Copyright (c) 2006-2008, John Mettraux, OpenWFE.org
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
@@ -78,10 +78,11 @@
#
# A simplification of caller_to_s for direct usage when debugging
#
def ldebug_callstack (msg, max_lines=nil)
+
ldebug { "#{msg}\n" + OpenWFE::caller_to_s(9, max_lines) }
end
private
@@ -99,15 +100,17 @@
$OWFE_LOG.send level, &logblock
end
def log_prepare (message)
+
return log_author() unless message
- return "#{log_author} - #{message}"
+ "#{log_author} - #{message}"
end
def log_author
- if respond_to? :service_name
+
+ if respond_to?(:service_name)
"#{self.class} '#{self.service_name}'"
else
"#{self.class}"
end
end