@kwirthmagnify/kwirth-provider-kafka 0.1.13 → 0.1.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/back.js +14 -2
  2. package/package.json +1 -1
package/back.js CHANGED
@@ -18603,6 +18603,18 @@ module.exports = __toCommonJS(index_exports);
18603
18603
  var import_kafkajs = __toESM(require_kafkajs(), 1);
18604
18604
  var KafkaProvider = class {
18605
18605
  constructor(_clusterInfo, _kwirthData) {
18606
+ /*
18607
+ Starts writing to the console — what it did before — and the core replaces it as soon as the
18608
+ provider is built. With an older core nobody calls setLogger and everything stays as it was.
18609
+ */
18610
+ this.log = {
18611
+ info: (message) => console.log(`[kafka] ${message}`),
18612
+ warning: (message) => console.warn(`[kafka] ${message}`),
18613
+ error: (message) => console.error(`[kafka] ${message}`)
18614
+ };
18615
+ this.setLogger = (logger) => {
18616
+ this.log = logger;
18617
+ };
18606
18618
  this.id = "kafka";
18607
18619
  this.providesRouter = false;
18608
18620
  this.router = void 0;
@@ -18724,11 +18736,11 @@ var KafkaProvider = class {
18724
18736
  await this.handleMessage(entry, topic, message.value?.toString());
18725
18737
  }
18726
18738
  }).catch((err) => {
18727
- console.error(`[kafka] consumer run error (key=${key}): ${err}`);
18739
+ this.log.error(`consumer run error (key=${key}): ${err}`);
18728
18740
  entry.running = false;
18729
18741
  });
18730
18742
  } catch (err) {
18731
- console.error(`[kafka] failed to start consumer (key=${key}): ${err}`);
18743
+ this.log.error(`failed to start consumer (key=${key}): ${err}`);
18732
18744
  entry.running = false;
18733
18745
  }
18734
18746
  }
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "id": "kafka",
5
5
  "name": "@kwirthmagnify/kwirth-provider-kafka",
6
6
  "displayName": "Kafka Provider",
7
- "version": "0.1.13",
7
+ "version": "0.1.14",
8
8
  "description": "Kafka provider plugin for Kwirth — subscribes to Kafka topics and dispatches events grouped by spaces",
9
9
  "requiresRestart": false,
10
10
  "requiresExtension": []