From 1e2554cb4c01f1e27f39cf357f59ef0e4dfb100b Mon Sep 17 00:00:00 2001 From: Frank Liu Date: Wed, 7 Aug 2024 11:41:14 -0700 Subject: [PATCH] [api] Fixes logging calling convention (#3394) --- .../main/java/ai/djl/translate/DeferredTranslatorFactory.java | 2 +- .../main/java/ai/djl/translate/ServingTranslatorFactory.java | 2 +- .../src/main/java/ai/djl/onnxruntime/engine/OrtEngine.java | 2 +- extensions/tokenizers/build.gradle.kts | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/api/src/main/java/ai/djl/translate/DeferredTranslatorFactory.java b/api/src/main/java/ai/djl/translate/DeferredTranslatorFactory.java index 5f01d372003..4702d3d1c38 100644 --- a/api/src/main/java/ai/djl/translate/DeferredTranslatorFactory.java +++ b/api/src/main/java/ai/djl/translate/DeferredTranslatorFactory.java @@ -76,7 +76,7 @@ private TranslatorFactory loadTranslatorFactory(String className) { Constructor constructor = subclass.getConstructor(); return constructor.newInstance(); } catch (Throwable e) { - logger.trace("Not able to load TranslatorFactory: " + className, e); + logger.trace("Not able to load TranslatorFactory: {}", className, e); } return null; } diff --git a/api/src/main/java/ai/djl/translate/ServingTranslatorFactory.java b/api/src/main/java/ai/djl/translate/ServingTranslatorFactory.java index 32680b084aa..866d35785bc 100644 --- a/api/src/main/java/ai/djl/translate/ServingTranslatorFactory.java +++ b/api/src/main/java/ai/djl/translate/ServingTranslatorFactory.java @@ -97,7 +97,7 @@ private TranslatorFactory loadTranslatorFactory(String className) { Constructor constructor = subclass.getConstructor(); return constructor.newInstance(); } catch (Throwable e) { - logger.trace("Not able to load TranslatorFactory: " + className, e); + logger.trace("Not able to load TranslatorFactory: {}", className, e); } return null; } diff --git a/engines/onnxruntime/onnxruntime-engine/src/main/java/ai/djl/onnxruntime/engine/OrtEngine.java b/engines/onnxruntime/onnxruntime-engine/src/main/java/ai/djl/onnxruntime/engine/OrtEngine.java index 9d312560bad..ee843bfdd04 100644 --- a/engines/onnxruntime/onnxruntime-engine/src/main/java/ai/djl/onnxruntime/engine/OrtEngine.java +++ b/engines/onnxruntime/onnxruntime-engine/src/main/java/ai/djl/onnxruntime/engine/OrtEngine.java @@ -115,7 +115,7 @@ public boolean hasCapability(String capability) { sessionOptions.addCUDA(); return true; } catch (OrtException e) { - logger.warn("CUDA is not supported OnnxRuntime engine: " + e.getMessage()); + logger.warn("CUDA is not supported OnnxRuntime engine: {}", e.getMessage()); return false; } } diff --git a/extensions/tokenizers/build.gradle.kts b/extensions/tokenizers/build.gradle.kts index 2e63b7da572..30fd0e4dcab 100644 --- a/extensions/tokenizers/build.gradle.kts +++ b/extensions/tokenizers/build.gradle.kts @@ -81,7 +81,7 @@ tasks { for (task in tasks) { var file = prefix / task / "ai.djl.huggingface.pytorch.json" if (file.exists()) - project.logger.lifecycle("PyTorch model zoo metadata alrady exists: $task") + project.logger.lifecycle("PyTorch model zoo metadata already exists: $task") else { project.logger.lifecycle("Downloading PyTorch model zoo metadata: $task") file.parentFile.mkdirs()