Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions api/resources/credits/jars.txt
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ jxl-2.6.3.jar|API|2.6.3|{link:jexcelapi|http://www.jexcelapi.org/}|{link:LGPL|ht
kaptcha-2.3.jar|Captcha generator|2.3|{link:kaptcha|http://code.google.com/p/kaptcha/}|{link:Apache 2.0|http://www.apache.org/licenses/LICENSE-2.0}|nicka|User signup forms
log4j-api-2.13.3.jar|Log4j|2.13.3|{link:Apache|https://logging.apache.org/log4j/2.x/}|{link:Apache 2.0|http://www.apache.org/licenses/LICENSE-2.0}|ankurj|Logging
log4j-core-2.13.3.jar|Log4j|2.13.3|{link:Apache|https://logging.apache.org/log4j/2.x/}|{link:Apache 2.0|http://www.apache.org/licenses/LICENSE-2.0}|ankurj|Logging
log4j-1.2-api-2.13.3.jar|Log4j|2.13.3|{link:Apache|https://logging.apache.org/log4j/2.x/}|{link:Apache 2.0|http://www.apache.org/licenses/LICENSE-2.0}|ankurj|Logging
objenesis-1.0.jar|Objenesis|1.0|{link:Objenesis|http://code.google.com/p/objenesis/}|{link:Apache 2.0|http://www.apache.org/licenses/LICENSE-2.0}|jeckels|Library for instantiating Java objects, dependency of jMock
opencsv-2.3.jar|OpenCSV|2.3|{link:OpenCSV|http://opencsv.sourceforge.net/}|{link:Apache 2.0|http://www.apache.org/licenses/LICENSE-2.0}|adam|Parsing CSV Files
patricia-trie-0.6.jar|PATRICIA Trie|0.6|{link:PATRICIA Trie|http://code.google.com/p/patricia-trie/}|{link:Apache 2.0|http://www.apache.org/licenses/LICENSE-2.0}|jeckels|PATRICIA Trie data structure implementation
Expand Down
4 changes: 2 additions & 2 deletions api/src/org/labkey/api/data/Table.java
Original file line number Diff line number Diff line change
Expand Up @@ -443,7 +443,7 @@ static void logException(@Nullable SQLFragment sql, @Nullable Connection conn, S
if (RuntimeSQLException.isConstraintException(e) && (StringUtils.startsWithIgnoreCase(trim, "INSERT") || StringUtils.startsWithIgnoreCase(trim, "UPDATE")))
{
// Log this ConstraintException if log Level is WARN (the default) or lower. Skip logging for callers that request just ERRORs.
if (Level.WARN.intLevel() >= logLevel.intLevel())
if (Level.WARN.isMoreSpecificThan(logLevel))
{
_log.warn("SQL Exception", e);
_logQuery(Level.WARN, sql, conn);
Expand All @@ -452,7 +452,7 @@ static void logException(@Nullable SQLFragment sql, @Nullable Connection conn, S
else
{
// Log this SQLException if log level is ERROR or lower.
if (Level.ERROR.intLevel() >= logLevel.intLevel())
if (Level.ERROR.isMoreSpecificThan(logLevel))
{
_log.error("SQL Exception", e);
_logQuery(Level.ERROR, sql, conn);
Expand Down
12 changes: 11 additions & 1 deletion api/src/org/labkey/api/pipeline/PipelineJob.java
Original file line number Diff line number Diff line change
Expand Up @@ -1436,6 +1436,7 @@ public void error(String message)
{
_job.getClassLogger().error(getSystemLogMessage(message));
write(message, null, Level.ERROR.toString());
setErrorStatus(message);
}

@Override
Expand All @@ -1451,6 +1452,7 @@ public void fatal(String message)
{
_job.getClassLogger().fatal(getSystemLogMessage(message));
write(message, null, Level.FATAL.toString());
setErrorStatus(message);
}

@Override
Expand All @@ -1461,6 +1463,14 @@ public void fatal(String message, Throwable t)
setErrorStatus(message);
}

// called from LogOutputStream.flush()
@Override
public void log(Level level, String message)
{
_job.getClassLogger().log(level, message);
write(message, null, level.toString());
}

private String getSystemLogMessage(Object message)
{
StringBuilder sb = new StringBuilder();
Expand Down Expand Up @@ -1506,7 +1516,7 @@ public void write(String message, @Nullable Throwable t, String level)
{
var line = formattedDate + " " +
String.format("%-5s", level) +
" : " +
": " +
message;
writer.write(line);
writer.write(LINE_SEP);
Expand Down
2 changes: 1 addition & 1 deletion api/src/org/labkey/api/query/MetadataParseWarning.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public MetadataParseWarning(String message)
public MetadataParseWarning(String message, Throwable cause, int line, int column)
{
super(message, cause, line, column);
_level = Level.WARN.intLevel();
_level = Level.WARN;
}

public MetadataParseWarning(String queryName, QueryParseException other)
Expand Down
8 changes: 4 additions & 4 deletions api/src/org/labkey/api/query/QueryParseException.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public class QueryParseException extends QueryException
{
protected int _line;
protected int _column;
protected int _level = Level.ERROR.intLevel();
protected Level _level = Level.ERROR;

public QueryParseException(String message, Throwable cause, int line, int column)
{
Expand All @@ -47,12 +47,12 @@ public QueryParseException(String queryName, QueryParseException other)

public boolean isError()
{
return _level >= Level.ERROR.intLevel();
return _level.isMoreSpecificThan(Level.ERROR);
}

public boolean isWarning()
{
return _level < Level.ERROR.intLevel();
return _level.isLessSpecificThan(Level.ERROR);
}


Expand All @@ -62,7 +62,7 @@ public String getMessage()
String ret = super.getMessage();
if (_line != 0)
{
if (_level == Level.WARN.intLevel())
if (_level.intLevel() == Level.WARN.intLevel())
ret = "Warning on line " + _line + ": " + ret;
else
ret = "Error on line " + _line + ": " + ret;
Expand Down
2 changes: 1 addition & 1 deletion api/src/org/labkey/api/query/QueryParseWarning.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,6 @@ public class QueryParseWarning extends QueryParseException
public QueryParseWarning(String message, Throwable cause, int line, int column)
{
super(message, cause, line, column);
_level = Level.WARN.intLevel();
_level = Level.WARN;
}
}
2 changes: 1 addition & 1 deletion study/src/org/labkey/study/importer/SpecimenImporter.java
Original file line number Diff line number Diff line change
Expand Up @@ -3514,7 +3514,7 @@ protected void checkForConflictingSpecimens(DbSchema schema, String tempTable, L
}
}

_logger.error(sb);
_logger.error(sb.toString());

// If conflicts are found, stop the import.
throw new IllegalStateException(sb.toString());
Expand Down