@faasjs/func 0.0.4-beta.6 → 0.0.4-beta.8

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.
package/dist/index.js CHANGED
@@ -123,24 +123,26 @@ var Func = class {
123
123
  * First time mount the function
124
124
  */
125
125
  async mount(data) {
126
- if (!data.logger)
127
- data.logger = new logger.Logger("Func");
128
- data.logger.debug("onMount");
126
+ var _a;
127
+ const logger$1 = new logger.Logger(((_a = data.logger) == null ? void 0 : _a.label) || "Func");
128
+ if (!logger$1.label.endsWith("Func"))
129
+ logger$1.label = `${logger$1.label}] [Func`;
130
+ logger$1.debug("onMount");
129
131
  if (this.mounted) {
130
- data.logger.warn("mount() has been called, skipped.");
132
+ logger$1.warn("mount() has been called, skipped.");
131
133
  return;
132
134
  }
133
135
  if (!data.config)
134
136
  data.config = this.config;
135
137
  try {
136
- data.logger.time("mount");
137
- data.logger.debug(
138
+ logger$1.time("mount");
139
+ logger$1.debug(
138
140
  `Plugins: ${this.plugins.map((p) => `${p.type}#${p.name}`).join(",")}`
139
141
  );
140
142
  await this.compose("onMount")(data);
141
143
  this.mounted = true;
142
144
  } finally {
143
- data.logger.timeEnd("mount", "mounted");
145
+ logger$1.timeEnd("mount", "mounted");
144
146
  }
145
147
  }
146
148
  /**
package/dist/index.mjs CHANGED
@@ -121,24 +121,26 @@ var Func = class {
121
121
  * First time mount the function
122
122
  */
123
123
  async mount(data) {
124
- if (!data.logger)
125
- data.logger = new Logger("Func");
126
- data.logger.debug("onMount");
124
+ var _a;
125
+ const logger = new Logger(((_a = data.logger) == null ? void 0 : _a.label) || "Func");
126
+ if (!logger.label.endsWith("Func"))
127
+ logger.label = `${logger.label}] [Func`;
128
+ logger.debug("onMount");
127
129
  if (this.mounted) {
128
- data.logger.warn("mount() has been called, skipped.");
130
+ logger.warn("mount() has been called, skipped.");
129
131
  return;
130
132
  }
131
133
  if (!data.config)
132
134
  data.config = this.config;
133
135
  try {
134
- data.logger.time("mount");
135
- data.logger.debug(
136
+ logger.time("mount");
137
+ logger.debug(
136
138
  `Plugins: ${this.plugins.map((p) => `${p.type}#${p.name}`).join(",")}`
137
139
  );
138
140
  await this.compose("onMount")(data);
139
141
  this.mounted = true;
140
142
  } finally {
141
- data.logger.timeEnd("mount", "mounted");
143
+ logger.timeEnd("mount", "mounted");
142
144
  }
143
145
  }
144
146
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@faasjs/func",
3
- "version": "0.0.4-beta.6",
3
+ "version": "0.0.4-beta.8",
4
4
  "license": "MIT",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -21,8 +21,8 @@
21
21
  "dist"
22
22
  ],
23
23
  "dependencies": {
24
- "@faasjs/deep_merge": "0.0.4-beta.6",
25
- "@faasjs/logger": "0.0.4-beta.6"
24
+ "@faasjs/deep_merge": "0.0.4-beta.8",
25
+ "@faasjs/logger": "0.0.4-beta.8"
26
26
  },
27
27
  "engines": {
28
28
  "npm": ">=9.0.0",