/*
 */

package org.subethamail.entity;

import java.io.IOException;

import javax.mail.MessagingException;

import org.hibernate.search.bridge.StringBridge;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.subethamail.common.SubEthaMessage;
import org.subethamail.core.util.Producers;

/**
 * Converts a byte[] of message content into a String for indexing
 * by Hibernate Search (aka Lucene).
 * 
 * @author Jeff Schnitzer
 */
public class MessageContentBridge implements StringBridge
{
	/** */
	private final static Logger log = LoggerFactory.getLogger(MessageContentBridge.class);

	@Override
	public String objectToString(Object arg0)
	{
		byte[] content = (byte[]) arg0;

		try
		{
			SubEthaMessage msg = new SubEthaMessage(Producers.instance().getMailSession(), content);
			return msg.getIndexableText();
		}
		catch (MessagingException ex)
		{
			log.error("Exception indexing content", ex);
		}
		catch (IOException ex)
		{
			log.error("Exception indexing content", ex);
		}
		
		return null;
	}
	
}


@@ -59,32 +59,65 @@
 io.IOException;%0D
+%0Aimport java.util.logging.Level;%0D
 %0A%0D%0Aimport javax.
@@ -140,24 +140,58 @@
 ception;%0D%0A%0D%0A
+import lombok.extern.java.Log;%0D%0A%0D%0A
 import org.h
@@ -232,67 +232,8 @@
 e;%0D%0A
-import org.slf4j.Logger;%0D%0Aimport org.slf4j.LoggerFactory;%0D%0A
 impo
@@ -470,16 +470,22 @@
 r%0D%0A */%0D%0A
+@Log%0D%0A
 public c
@@ -542,108 +542,8 @@
 %0A%7B%0D%0A
-%09/** */%0D%0A%09private final static Logger log = LoggerFactory.getLogger(MessageContentBridge.class);%0D%0A%0D%0A
 %09@Ov
@@ -816,35 +816,49 @@
 ex)%0D%0A%09%09%7B%0D%0A%09%09
-%09log.error(
+    log.log(Level.SEVERE,
 %22Exception i
@@ -923,19 +923,33 @@
 %0D%0A%09%09
-%09log.error(
+    log.log(Level.SEVERE,
 %22Exc

switch logging framework