Skip to content

Commit

Permalink
[Java Client] Switch from pretty print to compact print for configs (a…
Browse files Browse the repository at this point in the history
  • Loading branch information
michaeljmarshall authored Aug 10, 2021
1 parent daf457d commit 9af5e53
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ public ConsumerStatsRecorderImpl(PulsarClientImpl pulsarClient, ConsumerConfigur
private void init(ConsumerConfigurationData<?> conf) {
ObjectMapper m = new ObjectMapper();
m.configure(SerializationFeature.FAIL_ON_EMPTY_BEANS, false);
ObjectWriter w = m.writerWithDefaultPrettyPrinter();
ObjectWriter w = m.writer();

try {
log.info("Starting Pulsar consumer status recorder with config: {}", w.writeValueAsString(conf));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ public ProducerStatsRecorderImpl(PulsarClientImpl pulsarClient, ProducerConfigur
private void init(ProducerConfigurationData conf) {
ObjectMapper m = new ObjectMapper();
m.configure(SerializationFeature.FAIL_ON_EMPTY_BEANS, false);
ObjectWriter w = m.writerWithDefaultPrettyPrinter();
ObjectWriter w = m.writer();

try {
log.info("Starting Pulsar producer perf with config: {}", w.writeValueAsString(conf));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -396,8 +396,7 @@ public void start(AuthenticationService authenticationService,
log.info("/** Starting worker id={} **/", workerConfig.getWorkerId());

try {
log.info("Worker Configs: {}", new ObjectMapper().writerWithDefaultPrettyPrinter()
.writeValueAsString(workerConfig));
log.info("Worker Configs: {}", new ObjectMapper().writeValueAsString(workerConfig));
} catch (JsonProcessingException e) {
log.warn("Failed to print worker configs with error {}", e.getMessage(), e);
}
Expand Down

0 comments on commit 9af5e53

Please sign in to comment.