Skip to content

Commit 0de4287

Browse files
committed
chore(core): reduce debugging log level to TRACE
As a library, Springwolf does - log no fatal errors - log no error errors - log warn for configuration errors (detectable at startup) - log info for problems during runtime that impact Springwolf functionality (for example publishing) - log debug for information around Springwolf (start, finish, detected classes and method, ...) - log trace for more detail on information that are mostly relevant for debugging
1 parent a4752d6 commit 0de4287

File tree

19 files changed

+32
-32
lines changed

19 files changed

+32
-32
lines changed

springwolf-add-ons/springwolf-json-schema/src/main/java/io/github/springwolf/addons/json_schema/JsonSchemaCustomizer.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,14 +36,14 @@ public void customize(AsyncAPI asyncAPI) {
3636
}
3737

3838
try {
39-
log.debug("Generate json-schema for {}", entry.getKey());
39+
log.trace("Generate json-schema for {}", entry.getKey());
4040

4141
Object jsonSchema = jsonSchemaGenerator.fromSchema(componentSchema, componentSchemas);
4242
if (jsonSchema != null) {
4343
schema.getExtensionFields().putIfAbsent(EXTENSION_JSON_SCHEMA, jsonSchema);
4444
}
4545
} catch (Exception ex) {
46-
log.warn("Unable to create json-schema for {}", entry.getKey(), ex);
46+
log.info("Unable to create json-schema for {}", entry.getKey(), ex);
4747
}
4848
}
4949
}

springwolf-core/src/main/java/io/github/springwolf/core/asyncapi/channels/DefaultChannelsService.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public Map<String, ChannelObject> findChannels() {
3434
Map<String, ChannelObject> channels = scanner.scan();
3535
foundChannelItems.addAll(channels.values());
3636
} catch (Exception e) {
37-
log.error("An error was encountered during channel scanning with {}: {}", scanner, e.getMessage(), e);
37+
log.warn("An error was encountered during channel scanning with {}: {}", scanner, e.getMessage(), e);
3838
}
3939
}
4040
return ChannelMerger.mergeChannels(foundChannelItems);

springwolf-core/src/main/java/io/github/springwolf/core/asyncapi/components/DefaultComponentsService.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ public ComponentSchema resolvePayloadSchema(Type type, String contentType) {
7272
*/
7373
@Override
7474
public String registerSchema(SchemaObject schemaWithoutRef) {
75-
log.debug("Registering schema for {}", schemaWithoutRef.getTitle());
75+
log.trace("Registering schema for {}", schemaWithoutRef.getTitle());
7676

7777
ComponentSchema processedSchema = schemaService.postProcessSchemaWithoutRef(schemaWithoutRef);
7878
this.schemas.putIfAbsent(schemaWithoutRef.getTitle(), processedSchema);
@@ -98,7 +98,7 @@ public Map<String, Message> getMessages() {
9898
*/
9999
@Override
100100
public MessageReference registerMessage(MessageObject message) {
101-
log.debug("Registering message for {}", message.getMessageId());
101+
log.trace("Registering message for {}", message.getMessageId());
102102

103103
messages.putIfAbsent(message.getMessageId(), message);
104104

springwolf-core/src/main/java/io/github/springwolf/core/asyncapi/components/examples/walkers/DefaultSchemaWalker.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ public R fromSchema(Schema schema, Map<String, Schema> definitions) {
7676

7777
private Optional<T> buildExample(
7878
Optional<String> name, Schema schema, Map<String, Schema> definitions, Set<Schema> visited) {
79-
log.debug("Building example for schema {}", schema);
79+
log.trace("Building example for schema {}", schema);
8080

8181
Optional<T> exampleValue = getExampleFromSchemaAnnotation(name, schema);
8282
if (exampleValue.isPresent()) {

springwolf-core/src/main/java/io/github/springwolf/core/asyncapi/components/examples/walkers/json/ExampleJsonValueGenerator.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ public JsonNode createRaw(Object exampleValue) {
9090
try {
9191
return yamlMapper.readTree(exampleValue.toString());
9292
} catch (JacksonException e) {
93-
log.info("Unable to parse example to JsonNode: {}", exampleValue, e);
93+
log.debug("Unable to parse example to JsonNode: {}", exampleValue, e);
9494
return null;
9595
}
9696
}

springwolf-core/src/main/java/io/github/springwolf/core/asyncapi/components/examples/walkers/xml/ExampleXmlValueGenerator.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ public String prepareForSerialization(Schema schema, Node exampleObject) {
184184

185185
return xml;
186186
} catch (TransformerException | DOMException e) {
187-
log.error("Unable to serialize example for schema {}", schema.getName(), e);
187+
log.warn("Unable to serialize example for schema {}", schema.getName(), e);
188188
return null;
189189
}
190190
}

springwolf-core/src/main/java/io/github/springwolf/core/asyncapi/components/examples/walkers/yaml/ExampleYamlValueGenerator.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public String prepareForSerialization(Schema schema, JsonNode exampleObject) {
5050

5151
return exampleYamlValueSerializer.writeDocumentAsYamlString(exampleObject);
5252
} catch (JacksonException e) {
53-
log.error("Serialize {}", name, e);
53+
log.warn("Serialize {}", name, e);
5454
return null;
5555
}
5656
}

springwolf-core/src/main/java/io/github/springwolf/core/asyncapi/components/postprocessors/ExampleGeneratorPostProcessor.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public class ExampleGeneratorPostProcessor implements SchemasPostProcessor {
1919
@Override
2020
public void process(Schema schema, Map<String, Schema> definitions, String contentType) {
2121
if (schema.getExample() == null) {
22-
log.debug("Generate example for {}", schema.getName());
22+
log.trace("Generate example for {}", schema.getName());
2323

2424
Optional<SchemaWalker> schemaWalkerOptional = schemaWalkerProvider.generatorFor(contentType);
2525
if (schemaWalkerOptional.isPresent()) {

springwolf-core/src/main/java/io/github/springwolf/core/asyncapi/operations/DefaultOperationsService.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public Map<String, Operation> findOperations() {
3434
Map<String, Operation> channels = scanner.scan();
3535
foundOperations.addAll(channels.values());
3636
} catch (Exception e) {
37-
log.error("An error was encountered during operation scanning with {}: {}", scanner, e.getMessage(), e);
37+
log.warn("An error was encountered during operation scanning with {}: {}", scanner, e.getMessage(), e);
3838
}
3939
}
4040
return OperationMerger.mergeOperations(foundOperations);

springwolf-core/src/main/java/io/github/springwolf/core/asyncapi/scanners/classes/spring/annotations/ClassScannerUtil.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public static List<Class<?>> getClasses(String basePackages, TypeFilter filter,
3535

3636
private static Optional<Class<?>> getClass(String className) {
3737
try {
38-
log.debug("Found candidate class: {}", className);
38+
log.trace("Found candidate class: {}", className);
3939
return Optional.of(Class.forName(className));
4040
} catch (ClassNotFoundException e) {
4141
log.warn("Failed to get class for name: {}", className);

0 commit comments

Comments
 (0)