DateFormat df = new SimpleDateFormat( BrowserCoreConstants.DATEFORMAT );
String errorComment = "#!ERROR " + e.getMessage(); //$NON-NLS-1$
errorComment = errorComment.replaceAll( "\r", " " ); //$NON-NLS-1$ //$NON-NLS-2$
errorComment = errorComment.replaceAll( "\n", " " ); //$NON-NLS-1$ //$NON-NLS-2$
LdifCommentLine errorCommentLine = LdifCommentLine.create( errorComment );
logWriter.write( LdifCommentLine.create( "#!RESULT ERROR" ).toFormattedString() ); //$NON-NLS-1$
logWriter.write( LdifCommentLine.create(
"#!CONNECTION ldap://" + connection.getHost() + ":" + connection.getPort() ).toFormattedString() ); //$NON-NLS-1$ //$NON-NLS-2$
logWriter.write( LdifCommentLine.create( "#!DATE " + df.format( new Date() ) ).toFormattedString() ); //$NON-NLS-1$
logWriter.write( errorCommentLine.toFormattedString() );
logWriter.write( record.toFormattedString() );
}
catch ( IOException ioe )
{
monitor.reportError( BrowserCoreMessages.model__error_logging_modification, ioe );