@faasjs/func 0.0.4-beta.1 → 0.0.4-beta.10

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