From 058d356104316f77fb8a0a3525b030abf4d2cfef Mon Sep 17 00:00:00 2001 From: Daniel Molina Date: Fri, 14 Sep 2012 12:33:01 +0200 Subject: [PATCH] appflow: bug #1468 log does not show the component, only the log level --- flow/lib/log.rb | 15 +++++++++------ market/install.sh | 2 +- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/flow/lib/log.rb b/flow/lib/log.rb index eb7177539c..47a0dad4d5 100644 --- a/flow/lib/log.rb +++ b/flow/lib/log.rb @@ -34,11 +34,14 @@ class Log @log_level = Logger::DEBUG # Mon Feb 27 06:02:30 2012 [Clo] [E]: Error message example - MSG_FORMAT = %{%s [%s] [%s]: %s\n} + MSG_FORMAT = %{%s [%s]: [%s] %s\n} # Mon Feb 27 06:02:30 2012 DATE_FORMAT = "%a %b %d %H:%M:%S %Y" + # Message to be used in CloudLogger + CLOUD_LOGGER_MSG = %{[%s] %s} + # Sets the server logger # @param [CloudLogger::CloudLogger, Logger] logger def logger=(logger) @@ -64,7 +67,7 @@ class Log if service_id add(Logger::INFO, component, message, service_id) else - @@logger.info(message) + @@logger.info(CLOUD_LOGGER_MSG % [component, message]) end end @@ -81,7 +84,7 @@ class Log if service_id add(Logger::DEBUG, component, message, service_id) else - @@logger.debug(message) + @@logger.debug(CLOUD_LOGGER_MSG % [component, message]) end end @@ -98,7 +101,7 @@ class Log if service_id add(Logger::ERROR, component, message, service_id) else - @@logger.error(message) + @@logger.error(CLOUD_LOGGER_MSG % [component, message]) end end @@ -115,7 +118,7 @@ class Log if service_id add(Logger::WARN, component, message, service_id) else - @@logger.warn(message) + @@logger.warn(CLOUD_LOGGER_MSG % [component, message]) end end @@ -130,8 +133,8 @@ class Log open("#{LOG_LOCATION}/appflow/#{service_id}.log", 'a') do |f| f << MSG_FORMAT % [ Time.now.strftime(DATE_FORMAT), - component, Logger::SEV_LABEL[severity][0..0], + component, message ] end end diff --git a/market/install.sh b/market/install.sh index 693a7363a4..ef1e3a6134 100755 --- a/market/install.sh +++ b/market/install.sh @@ -53,7 +53,7 @@ do_file() { rm $2/`basename $1` else if [ "$LINK" = "yes" ]; then - ln -s $SRC_DIR/$1 $2 + ln -fs $SRC_DIR/$1 $2 else cp -R $SRC_DIR/$1 $2 fi