From a22671b03f7f61269fb98f9fa0a12b3d7b4a40df Mon Sep 17 00:00:00 2001 From: Alex Barth <alex_b@53995.no-reply.drupal.org> Date: Fri, 29 Oct 2010 19:25:54 +0000 Subject: [PATCH] Set watchdog error level to 'error' for number of fails. --- plugins/FeedsProcessor.inc | 45 +++++++++++++++++++++++--------------- 1 file changed, 27 insertions(+), 18 deletions(-) diff --git a/plugins/FeedsProcessor.inc b/plugins/FeedsProcessor.inc index 621830eb..c6883347 100644 --- a/plugins/FeedsProcessor.inc +++ b/plugins/FeedsProcessor.inc @@ -160,35 +160,44 @@ abstract class FeedsProcessor extends FeedsPlugin { ); $messages = array(); if ($state->created) { - $messages[] = format_plural( - $state->created, - 'Created @number @entity', - 'Created @number @entities', - array('@number' => $state->created) + $tokens + $messages[] = array( + 'message' => format_plural( + $state->created, + 'Created @number @entity', + 'Created @number @entities', + array('@number' => $state->created) + $tokens + ), ); } if ($state->updated) { - $messages[] = format_plural( - $state->updated, - 'Updated @number @entity', - 'Updated @number @entities', - array('@number' => $state->updated) + $tokens + $messages[] = array( + 'message' => format_plural( + $state->updated, + 'Updated @number @entity', + 'Updated @number @entities', + array('@number' => $state->updated) + $tokens + ), ); } if ($state->failed) { - $messages[] = format_plural( - $state->failed, - 'Failed importing @number @entity', - 'Failed importing @number @entities', - array('@number' => $state->failed) + $tokens + $messages[] = array( + 'message' => format_plural( + $state->failed, + 'Failed importing @number @entity', + 'Failed importing @number @entities', + array('@number' => $state->failed) + $tokens + ), + 'level' => WATCHDOG_ERROR, ); } if (empty($messages)) { - $messages[] = t('There are no new @entities.', array('@entities' => strtolower($info['label plural']))); + $messages[] = array( + 'message' => t('There are no new @entities.', array('@entities' => strtolower($info['label plural']))), + ); } foreach ($messages as $message) { - drupal_set_message($message); - $source->log('import', $message, array(), WATCHDOG_INFO); + drupal_set_message($message['message']); + $source->log('import', $message, array(), isset($message['level']) ? $message['level'] : WATCHDOG_INFO); } } -- GitLab