1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-08-07 00:05:53 +02:00
This commit is contained in:
John Camelon 2004-06-17 18:44:38 +00:00
parent 67ad3bb4b0
commit 954d5b8b45
3 changed files with 8 additions and 10 deletions

View file

@ -18,7 +18,7 @@ public interface IParserLogService
{ {
public void traceLog( String message ); public void traceLog( String message );
public void errorLog( String message ); // public void errorLog( String message );
public boolean isTracing(); public boolean isTracing();

View file

@ -1097,7 +1097,7 @@ public class ExpressionParser implements IExpressionParser, IParserData {
* @param e * @param e
*/ */
public void logException(String methodName, Exception e) { public void logException(String methodName, Exception e) {
if (!(e instanceof EndOfFileException) && e != null) { if (!(e instanceof EndOfFileException) && e != null && log.isTracing()) {
StringBuffer buffer = new StringBuffer(); StringBuffer buffer = new StringBuffer();
buffer.append("Parser: Unexpected exception in "); //$NON-NLS-1$ buffer.append("Parser: Unexpected exception in "); //$NON-NLS-1$
buffer.append(methodName); buffer.append(methodName);
@ -1107,9 +1107,8 @@ public class ExpressionParser implements IExpressionParser, IParserData {
buffer.append(e.getMessage()); buffer.append(e.getMessage());
buffer.append(". w/"); //$NON-NLS-1$ buffer.append(". w/"); //$NON-NLS-1$
buffer.append(scanner.toString()); buffer.append(scanner.toString());
if (log.isTracing()) log.traceLog(buffer.toString());
log.traceLog(buffer.toString()); // log.errorLog(buffer.toString());
log.errorLog(buffer.toString());
} }
} }
@ -2593,7 +2592,7 @@ public class ExpressionParser implements IExpressionParser, IParserData {
.outputTrace( .outputTrace(
log, log,
"ScannerException thrown : ", e.getProblem(), null, null, null); //$NON-NLS-1$ "ScannerException thrown : ", e.getProblem(), null, null, null); //$NON-NLS-1$
log.errorLog("Scanner Exception: " + e.getProblem().getMessage()); //$NON-NLS-1$ // log.errorLog("Scanner Exception: " + e.getProblem().getMessage()); //$NON-NLS-1$
return fetchToken(); return fetchToken();
} }
} }

View file

@ -243,7 +243,7 @@ public abstract class Parser extends ExpressionParser implements IParser
* @param e * @param e
*/ */
private void logThrowable(String methodName, Throwable e) { private void logThrowable(String methodName, Throwable e) {
if( e != null ) if( e != null && log.isTracing())
{ {
StringBuffer buffer = new StringBuffer(); StringBuffer buffer = new StringBuffer();
buffer.append( "Parser: Unexpected throwable in "); //$NON-NLS-1$ buffer.append( "Parser: Unexpected throwable in "); //$NON-NLS-1$
@ -254,9 +254,8 @@ public abstract class Parser extends ExpressionParser implements IParser
buffer.append( e.getMessage() ); buffer.append( e.getMessage() );
buffer.append( ". w/"); //$NON-NLS-1$ buffer.append( ". w/"); //$NON-NLS-1$
buffer.append( scanner.toString() ); buffer.append( scanner.toString() );
if( log.isTracing() ) log.traceLog( buffer.toString() );
log.traceLog( buffer.toString() ); // log.errorLog( buffer.toString() );
log.errorLog( buffer.toString() );
} }
} }