mirror of
https://github.com/sbt/sbt.git
synced 2026-08-30 17:54:25 +02:00
more flexible scalac logging
the custom scalac Reporter now delegates to an instance of an sbt interface called xsbti.Reporter handling compilation logging is now mainly done on the sbt-side of the compiler interface the xsbti.Reporter interface provides access to richer information about errors and warnings, including source file, line, and offset xsbti.Reporter can be implemented by users to get access to detailed information without needing to parse the logging output the CompileFailed exception that is thrown when compilation fails now includes an array of the problems, providing detailed error and warning information that can, for example, be consumed by doing a mapFailure on 'compile' and using 'Compile.allProblems'
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
/* sbt -- Simple Build Tool
|
||||
* Copyright 2008, 2009, 2010 Mark Harrah
|
||||
*/
|
||||
package xsbti;
|
||||
|
||||
public interface Reporter
|
||||
{
|
||||
/** Resets logging, including any accumulated errors, warnings, messages, and counts.*/
|
||||
public void reset();
|
||||
/** Returns true if this logger has seen any errors since the last call to reset.*/
|
||||
public boolean hasErrors();
|
||||
/** Returns true if this logger has seen any warnings since the last call to reset.*/
|
||||
public boolean hasWarnings();
|
||||
/** Logs a summary of logging since the last reset.*/
|
||||
public void printSummary();
|
||||
/** Returns a list of warnings and errors since the last reset.*/
|
||||
public Problem[] problems();
|
||||
/** Logs a message.*/
|
||||
public void log(Position pos, String msg, Severity sev);
|
||||
}
|
||||
Reference in New Issue
Block a user