Skip to content

Commit

Permalink
Parameterize SLF4J's logging statements (#1617)
Browse files Browse the repository at this point in the history
* * automated rewrite of SLF4J logging

* * fix excluded classes from previous step
  • Loading branch information
stephanr authored Dec 13, 2023
1 parent 1fbb503 commit 4a715f7
Show file tree
Hide file tree
Showing 339 changed files with 1,678 additions and 1,647 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -98,12 +98,12 @@ protected Object getConvertedValue(FacesContext context, Object newSubmittedValu
@Override
protected void validateValue(FacesContext context, Object newValue) {
super.validateValue(context, newValue);
LOG.debug("validate value " + newValue);
LOG.debug("validate value {}", newValue);
try {
String v = (String) newValue;
InputStream xml = new ByteArrayInputStream(v.getBytes("UTF-8"));
String s = getSchemaURLS();
LOG.debug("Schemas: " + s);
LOG.debug("Schemas: {}", s);
String[] schemas = null;
if (s != null && s.length() > 0) {
schemas = s.split(",");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,11 @@ public class DebugPhaseListener implements PhaseListener {
private static final Logger LOG = getLogger(DebugPhaseListener.class);

public void afterPhase(PhaseEvent event) {
LOG.debug("After phase: " + event.getPhaseId());
LOG.debug("After phase: {}", event.getPhaseId());
}

public void beforePhase(PhaseEvent event) {
LOG.debug("Before phase: " + event.getPhaseId());
LOG.debug("Before phase: {}", event.getPhaseId());
}

public PhaseId getPhaseId() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public class EncodingFilter implements Filter {
@Override
public void init(FilterConfig filterConfig) throws ServletException {
String enc = filterConfig.getInitParameter("encoding");
LOG.debug("Init paramater 'encoding' is set to: " + enc);
LOG.debug("Init paramater 'encoding' is set to: {}", enc);
if (enc != null && enc.length() > 0)
encoding = enc;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ private File getTargetFile(ServletContext sc, String target, String fileName) th
targetFile = File.createTempFile("upload", "", tempDir);
}

LOG.info("Uploading file '" + fileName + "' to: '" + targetFile + "'");
LOG.info("Uploading file '{}' to: '{}'", fileName, targetFile);
return targetFile;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ private void encodeDownload(ResponseWriter writer, HtmlOutputXML xmlComponent) t
thread.start();
}
catch (Exception e) {
LOG.warn("Could not write file for download: " + e.getMessage());
LOG.warn("Could not write file for download: {}", e.getMessage());
return;
}

Expand Down Expand Up @@ -333,19 +333,19 @@ public void run() {
DeleteThread.sleep(secondesUntilDelete);
}
catch (InterruptedException e) {
LOG.debug("Could not sleep delete thread: " + e.getMessage());
LOG.debug("Could not sleep delete thread: {}", e.getMessage());
}
if (fileToDelete != null) {
try {
if (fileToDelete.delete()) {
LOG.debug("Successfully deleted file " + fileToDelete.getName());
LOG.debug("Successfully deleted file {}", fileToDelete.getName());
}
else {
LOG.debug("Could not delete file " + fileToDelete.getName());
LOG.debug("Could not delete file {}", fileToDelete.getName());
}
}
catch (Exception e) {
LOG.error("Could not delete file " + fileToDelete.getName() + ": " + e.getMessage());
LOG.error("Could not delete file {}: {}", fileToDelete.getName(), e.getMessage());
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,15 +91,15 @@ public ExecutionOutput[] execute(Process processToExecute, Map<String, StringPai
FacesContext fc = FacesContext.getCurrentInstance();
try {
if (LOG.isDebugEnabled()) {
LOG.debug("execute selected process " + processToExecute.getId());
LOG.debug("input parameters (LITERAL): " + literalInputs);
LOG.debug("input parameters (XML): " + xmlInputs);
LOG.debug("input parameters (XML-REFS): " + xmlRefInputs);
LOG.debug("input parameters (BINARY): " + binaryInputs);
LOG.debug("input parameters (BBOX): " + bboxInputs);
LOG.debug("input formats: " + complexInputFormats);
LOG.debug("outputs: " + outputs);
LOG.debug("output formats: " + complexOutputFormats);
LOG.debug("execute selected process {}", processToExecute.getId());
LOG.debug("input parameters (LITERAL): {}", literalInputs);
LOG.debug("input parameters (XML): {}", xmlInputs);
LOG.debug("input parameters (XML-REFS): {}", xmlRefInputs);
LOG.debug("input parameters (BINARY): {}", binaryInputs);
LOG.debug("input parameters (BBOX): {}", bboxInputs);
LOG.debug("input formats: {}", complexInputFormats);
LOG.debug("outputs: {}", outputs);
LOG.debug("output formats: {}", complexOutputFormats);
}
ProcessExecution execution = processToExecute.prepareExecution();
InputType[] inputDescription = processToExecute.getInputTypes();
Expand Down Expand Up @@ -172,7 +172,7 @@ else if (input instanceof BBoxInputType) {
encoding = complexOutputFormats.get(out).getEncoding();
mimeType = complexOutputFormats.get(out).getMimeType();
}
LOG.debug("Append output " + out + " with format " + schema + ", " + encoding + ", " + mimeType);
LOG.debug("Append output {} with format {}, {}, {}", out, schema, encoding, mimeType);
execution.addOutput(out, null, null, true, mimeType, encoding, schema);
}
ExecutionOutputs response = execution.execute();
Expand Down Expand Up @@ -222,7 +222,7 @@ public void run() {
if (fileToDelete != null && fileToDelete.exists()) {
boolean delete = fileToDelete.delete();
if (!delete) {
LOG.debug("File " + fileToDelete + " could not be deletet!");
LOG.debug("File {} could not be deletet!", fileToDelete);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ public void create(ComponentSystemEvent event) throws AbortProcessingException {
Process process = cb.getSelectedProcess();

if (process != null) {
LOG.debug("create form for process: " + process.getId());
LOG.debug("create form for process: {}", process.getId());
if (executeForm == null) {
executeForm = new HtmlForm();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ else if (INDEX_PARAM.equals(param.getName())) {
}
}
}
LOG.debug("Updatie from: " + id + "; type: " + type + "; occ: " + occurences);
LOG.debug("Updatie from: {}; type: {}; occ: {}", id, type, occurences);
if (occurences == null) {
occurences = new HashMap<String, Integer>();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ public Map<String, Object> getParams() {
}

public Object print() {
LOG.debug("try to print template " + template);
LOG.debug("try to print template {}", template);
if (template == null) {
// TODO: msg

Expand Down Expand Up @@ -124,7 +124,7 @@ public Object print() {
ComplexOutput o = (ComplexOutput) exe.execute()
.get(outputTypes[0].getId().getCode(), outputTypes[0].getId().getCodeSpace());
String link = o.getWebAccessibleURI().toASCIIString();
LOG.debug("Result can be found here: " + link);
LOG.debug("Result can be found here: {}", link);
result = link;
}
catch (Exception e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ private void updateTemplateMetadata() {
}

public void renderMetaInfo(ComponentSystemEvent event) throws AbortProcessingException {
LOG.debug("append template GUI elements for template " + template);
LOG.debug("append template GUI elements for template {}", template);

if (metaInfoGrp == null) {
metaInfoGrp = new HtmlPanelGrid();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,9 @@ public void destroy() {
}
}
else {
LOG.warn("Unable to close connection pool {}. Check the DataSource configuration if the attribute "
+ "'destroyMethod' is configured.", resourceMetadata.getIdentifier());
LOG.warn(
"Unable to close connection pool {}. Check the DataSource configuration if the attribute 'destroyMethod' is configured.",
resourceMetadata.getIdentifier());
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public class JndiLookup {
* <code>javax.sql.DataSource</code>
*/
public static final DataSource lookup(final String jndiName) throws NamingException, ClassCastException {
LOG.debug("Looking up JNDI DataSource '" + jndiName + "'");
LOG.debug("Looking up JNDI DataSource '{}'", jndiName);
Object object = null;
try {
final InitialContext initialContext = new InitialContext();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,13 +150,13 @@ public MultiresolutionMesh(File mrIndex, File meshFragments, DirectByteBufferPoo
blobBuffer.limit(arcsSegmentStart);
ByteBuffer nodesBuffer = blobBuffer.slice();

LOG.info("MultiresolutionMesh: flags=" + flags + ", #rowsPerMt: " + rowsPerMt + ", #fragments: " + numFragments
+ ", #nodes: " + numNodes + ", #arcs: " + numArcs);
LOG.debug("- nodesBuffer: [" + nodesSegmentStart + '-' + (arcsSegmentStart - 1) + "]");
LOG.debug("- arcsBuffer: [" + arcsSegmentStart + '-' + (fragmentsSegmentStart - 1) + "]");
LOG.debug("- patchesBuffer: [" + fragmentsSegmentStart + '-' + (blobBuffer.capacity() - 1) + "]");
LOG.info("MultiresolutionMesh: flags={}, #rowsPerMt: {}, #fragments: {}, #nodes: {}, #arcs: {}", flags,
rowsPerMt, numFragments, numNodes, numArcs);
LOG.debug("- nodesBuffer: [{}-{}]", nodesSegmentStart, (arcsSegmentStart - 1));
LOG.debug("- arcsBuffer: [{}-{}]", arcsSegmentStart, (fragmentsSegmentStart - 1));
LOG.debug("- patchesBuffer: [{}-{}]", fragmentsSegmentStart, (blobBuffer.capacity() - 1));
elapsed = System.currentTimeMillis() - begin;
LOG.debug("mrindex_init=" + elapsed);
LOG.debug("mrindex_init={}", elapsed);

nodes = createNodes(nodesBuffer);
arcs = createArcs(arcsBuffer);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ private void adaptTopDown() {
}

long elapsed = System.currentTimeMillis() - begin;
LOG.debug("Selective refinement (top-down): " + elapsed + " ms");
LOG.debug("Selective refinement (top-down): {} ms", elapsed);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ private void adaptTopDown() {
}

long elapsed = System.currentTimeMillis() - begin;
LOG.debug("Spatial selection (top-down): " + elapsed + " ms");
LOG.debug("Spatial selection (top-down): {} ms", elapsed);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,15 +155,14 @@ private boolean isTexturable(MeshFragment fragment) {
resolution = 0.00001;
}
double textureSize = getMaxSideLen(fragment) / resolution;
LOG.debug("Side len: " + getMaxSideLen(fragment) + ", resolution: " + resolution + ", texture size: "
+ textureSize);
LOG.debug("Side len: {}, resolution: {}, texture size: {}", getMaxSideLen(fragment), resolution, textureSize);
if (textureSize > maxTextureSize) {
LOG.debug("Side len: " + getMaxSideLen(fragment) + ", resolution: " + resolution + ", texture size: "
+ textureSize);
LOG.debug("Side len: {}, resolution: {}, texture size: {}", getMaxSideLen(fragment), resolution,
textureSize);
}
else {
LOG.debug("No refinement needed, Side len: " + getMaxSideLen(fragment) + ", resolution: " + resolution
+ ", texture size: " + textureSize);
LOG.debug("No refinement needed, Side len: {}, resolution: {}, texture size: {}", getMaxSideLen(fragment),
resolution, textureSize);
}

return textureSize <= maxTextureSize;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,11 +110,11 @@ public MeshFragmentData read(int fragmentId, long offset, int length) throws IOE
ByteBuffer rawTileBuffer = pooledByteBuffer.getBuffer();
// rawTileBuffer.order( ByteOrder.nativeOrder() );

LOG.debug("Reading mesh fragment with id " + fragmentId + " (offset: " + offset + ", length: " + length + ").");
LOG.debug("Reading mesh fragment with id {} (offset: {}, length: {}).", fragmentId, offset, length);
long begin = System.currentTimeMillis();
channel.read(rawTileBuffer, offset);
long elapsed = System.currentTimeMillis() - begin;
LOG.debug("Reading took " + elapsed + " milliseconds.");
LOG.debug("Reading took {} milliseconds.", elapsed);

rawTileBuffer.rewind();
int numVertices = rawTileBuffer.getInt();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ else if (patch.getGeometricError() >= 1.0) {

@Override
public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) {
LOG.trace("reshape( GLAutoDrawable, " + x + ", " + y + ", " + width + ", " + height + " ) called");
LOG.trace("reshape( GLAutoDrawable, {}, {}, {}, {} ) called", x, y, width, height);

GL gl = drawable.getGL();
gl.glViewport(x, y, width, height);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -171,11 +171,11 @@ public void display(GLAutoDrawable theDrawable) {
trackBall.multModelMatrix(gl, centroid);
float[] newEye = JOGLUtils.getEyeFromModelView(gl);
if (LOG.isDebugEnabled()) {
LOG.debug("farClippingPlane:" + farClippingPlane);
LOG.debug("centroid:" + centroid[0] + "," + centroid[1] + "," + centroid[2]);
LOG.debug("lookAt:" + lookAt[0] + "," + lookAt[1] + "," + lookAt[2]);
LOG.debug("eye:" + eye[0] + "," + eye[1] + "," + eye[2]);
LOG.debug("Eye in model space: " + Vectors3f.asString(newEye));
LOG.debug("farClippingPlane:{}", farClippingPlane);
LOG.debug("centroid:{},{},{}", centroid[0], centroid[1], centroid[2]);
LOG.debug("lookAt:{},{},{}", lookAt[0], lookAt[1], lookAt[2]);
LOG.debug("eye:{},{},{}", eye[0], eye[1], eye[2]);
LOG.debug("Eye in model space: {}", Vectors3f.asString(newEye));
}

Point3d newEyeP = new Point3d(newEye[0], newEye[1], newEye[2]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ else if (request.getUnitsPerPixel() <= 25.6) {

@Override
public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) {
LOG.trace("reshape( GLAutoDrawable, " + x + ", " + y + ", " + width + ", " + height + " ) called");
LOG.trace("reshape( GLAutoDrawable, {}, {}, {}, {} ) called", x, y, width, height);

GL gl = drawable.getGL();
gl.glViewport(x, y, width, height);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -188,11 +188,10 @@ public void mouseDragged(MouseEvent e) {
@SuppressWarnings("null")
public void multModelMatrix(GL context, float[] worldTranslation) {
if (LOG.isDebugEnabled()) {
LOG.debug(
"worldTranslation: " + worldTranslation[0] + "," + worldTranslation[1] + "," + worldTranslation[2]);
LOG.debug("tbRot: " + tbRot[0] + "," + tbRot[1] + "," + tbRot[2] + "," + tbRot[3]);
LOG.debug("rotationVector: " + rotationVector[0] + "," + rotationVector[1] + "," + rotationVector[2] + ","
+ rotationVector[3]);
LOG.debug("worldTranslation: {},{},{}", worldTranslation[0], worldTranslation[1], worldTranslation[2]);
LOG.debug("tbRot: {},{},{},{}", tbRot[0], tbRot[1], tbRot[2], tbRot[3]);
LOG.debug("rotationVector: {},{},{},{}", rotationVector[0], rotationVector[1], rotationVector[2],
rotationVector[3]);
}
boolean translate = (worldTranslation != null) && (worldTranslation.length == 3);
if (translate) {
Expand Down Expand Up @@ -262,11 +261,11 @@ private void start(GLAutoDrawable drawable, Point point) {
startPoint[2] = ((float) Math.sqrt((radius * radius) - xxyy));
}
if (LOG.isDebugEnabled()) {
LOG.debug("width: " + windowWidth);
LOG.debug("height: " + windowHeight);
LOG.debug("center: " + center);
LOG.debug("radius: " + radius);
LOG.debug("startpoint: " + startPoint[0] + "," + startPoint[1] + "," + startPoint[2]);
LOG.debug("width: {}", windowWidth);
LOG.debug("height: {}", windowHeight);
LOG.debug("center: {}", center);
LOG.debug("radius: {}", radius);
LOG.debug("startpoint: {},{},{}", startPoint[0], startPoint[1], startPoint[2]);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public class ShaderProgram {
* @throws RuntimeException if the shader could not be compiled or linked.
*/
public int createVertexShader(GL glContext, String vertexShaderSource) throws RuntimeException {
LOG.debug("Adding vertex shader source: " + vertexShaderSource);
LOG.debug("Adding vertex shader source: {}", vertexShaderSource);
return compileShader(glContext, GL.GL_VERTEX_SHADER, vertexShaderSource);
}

Expand All @@ -76,7 +76,7 @@ public int createVertexShader(GL glContext, String vertexShaderSource) throws Ru
* @throws RuntimeException if the shader could not be compiled or linked.
*/
public int createFragmentShader(GL glContext, String fragmentShaderSource) throws RuntimeException {
LOG.debug("Adding fragment shader source: " + fragmentShaderSource);
LOG.debug("Adding fragment shader source: {}", fragmentShaderSource);
return compileShader(glContext, GL.GL_FRAGMENT_SHADER, fragmentShaderSource);
}

Expand All @@ -98,8 +98,9 @@ private int compileShader(GL gl, int GL_SHADER_ID, String shaderSource) throws R
shaderId = compileShaderProgram(gl, GL_SHADER_ID, shaderSource);
}
catch (RuntimeException r) {
LOG.error("Could not compile " + ((GL.GL_VERTEX_SHADER == GL_SHADER_ID) ? "vertex" : "fragment")
+ " shader from source: \n" + shaderSource + " \nbecause: " + r.getLocalizedMessage(), r);
LOG.error("Could not compile {} shader from source: \n{} \nbecause: {}",
((GL.GL_VERTEX_SHADER == GL_SHADER_ID) ? "vertex" : "fragment"), shaderSource,
r.getLocalizedMessage(), r);
throw (r);
}

Expand Down Expand Up @@ -212,8 +213,8 @@ public boolean attachShader(GL gl, int shaderId) {
result = true;
}
else {
LOG.warn("Either the program id: " + oglProgramId + " or the given shader id: " + shaderId
+ " are not valid, cannot attach the shader.");
LOG.warn("Either the program id: {} or the given shader id: {} are not valid, cannot attach the shader.",
oglProgramId, shaderId);
}
return result;
}
Expand All @@ -231,15 +232,15 @@ public boolean linkProgram(GL gl) throws RuntimeException {
result = true;
}
catch (RuntimeException r) {
LOG.error("Could not link shader because: " + r.getLocalizedMessage(), r);
LOG.error("Could not link shader because: {}", r.getLocalizedMessage(), r);
throw (r);
}
// if ( LOG.isDebugEnabled() ) {
try {
validateShaderProgram(gl);
}
catch (RuntimeException r) {
LOG.warn("Shader program source: was not valid because: " + r.getLocalizedMessage());
LOG.warn("Shader program source: was not valid because: {}", r.getLocalizedMessage());
result = false;
}
return result;
Expand All @@ -258,8 +259,8 @@ public boolean detachShader(GL gl, int shaderId) {
result = true;
}
else {
LOG.warn("Either the program id: " + oglProgramId + " or the given shader id: " + shaderId
+ " are not valid, cannot detach the shader.");
LOG.warn("Either the program id: {} or the given shader id: {} are not valid, cannot detach the shader.",
oglProgramId, shaderId);
}
return result;
}
Expand Down
Loading

0 comments on commit 4a715f7

Please sign in to comment.