pim-import 2.79.0 → 2.79.1
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/libs/logs.js +1 -19
- package/dist/libs/logs.js.map +1 -1
- package/package.json +1 -2
- package/src/libs/logs.ts +23 -23
- package/types/libs/logs.d.ts +1 -1
package/dist/libs/logs.js
CHANGED
|
@@ -3,26 +3,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.log = exports.setLogOptions = exports.setLogId = exports.getLogger = exports.logLevelToHide = exports.logStatus = void 0;
|
|
4
4
|
exports.logStatus = true;
|
|
5
5
|
exports.logLevelToHide = [];
|
|
6
|
-
const logdna = require("@logdna/logger");
|
|
7
|
-
let logger = null;
|
|
8
6
|
let logId = "";
|
|
9
7
|
let logOpts = {};
|
|
10
8
|
const getLogger = () => {
|
|
11
|
-
|
|
12
|
-
}
|
|
13
|
-
else if (process?.env?.FPI_LOGDNA_KEY &&
|
|
14
|
-
process?.env?.FPI_LOGDNA_APP_NAME) {
|
|
15
|
-
const options = {
|
|
16
|
-
app: process.env.FPI_LOGDNA_APP_NAME,
|
|
17
|
-
level: "debug",
|
|
18
|
-
};
|
|
19
|
-
logger = logdna.createLogger(process.env.FPI_LOGDNA_KEY, options);
|
|
20
|
-
logger.on("error", console.error);
|
|
21
|
-
}
|
|
22
|
-
else {
|
|
23
|
-
console.log("FPI_LOGDNA_KEY or FPI_LOGDNA_APP_NAME evironment variables not found");
|
|
24
|
-
}
|
|
25
|
-
return logger;
|
|
9
|
+
return null;
|
|
26
10
|
};
|
|
27
11
|
exports.getLogger = getLogger;
|
|
28
12
|
const setLogId = (id) => {
|
|
@@ -38,7 +22,6 @@ const log = (message, level = "DEBUG") => {
|
|
|
38
22
|
message = logId ? `[${logId}] - ${message}` : message;
|
|
39
23
|
if (level === "ERROR") {
|
|
40
24
|
if (Logger) {
|
|
41
|
-
Logger.error(message);
|
|
42
25
|
throw new Error(message);
|
|
43
26
|
}
|
|
44
27
|
else {
|
|
@@ -49,7 +32,6 @@ const log = (message, level = "DEBUG") => {
|
|
|
49
32
|
if (Logger) {
|
|
50
33
|
console.log(`${level} - ${message}`);
|
|
51
34
|
logOpts.level = level;
|
|
52
|
-
Logger.log(message, logOpts);
|
|
53
35
|
}
|
|
54
36
|
else {
|
|
55
37
|
const date = new Date();
|
package/dist/libs/logs.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logs.js","sourceRoot":"","sources":["../../src/libs/logs.ts"],"names":[],"mappings":";;;AAEa,QAAA,SAAS,GAAG,IAAI,CAAC;AACjB,QAAA,cAAc,GAAgB,EAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"logs.js","sourceRoot":"","sources":["../../src/libs/logs.ts"],"names":[],"mappings":";;;AAEa,QAAA,SAAS,GAAG,IAAI,CAAC;AACjB,QAAA,cAAc,GAAgB,EAAE,CAAC;AAI9C,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAI,OAAO,GAAkB,EAAE,CAAC;AAEzB,MAAM,SAAS,GAAG,GAAG,EAAE;IAoB5B,OAAO,IAAI,CAAC;AACd,CAAC,CAAC;AArBW,QAAA,SAAS,aAqBpB;AAEK,MAAM,QAAQ,GAAG,CAAC,EAAU,EAAE,EAAE;IACrC,KAAK,GAAG,EAAE,CAAC;AACb,CAAC,CAAC;AAFW,QAAA,QAAQ,YAEnB;AAEK,MAAM,aAAa,GAAG,CAAC,IAAmB,EAAE,EAAE;IACnD,OAAO,GAAG,IAAI,CAAC;AACjB,CAAC,CAAC;AAFW,QAAA,aAAa,iBAExB;AAEK,MAAM,GAAG,GAAG,CAAC,OAAe,EAAE,QAAmB,OAAO,EAAE,EAAE;IACjE,MAAM,MAAM,GAAG,iBAAS,EAAE,CAAC;IAE3B,OAAO,GAAG,KAAK,CAAC,CAAC,CAAC,IAAI,KAAK,OAAO,OAAO,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC;IACtD,IAAI,KAAK,KAAK,OAAO,EAAE;QACrB,IAAI,MAAM,EAAE;YAEV,MAAM,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC;SAC1B;aAAM;YACL,MAAM,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC;SAC1B;KACF;SAAM,IAAI,iBAAS,IAAI,CAAC,sBAAc,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE;QACvD,IAAI,MAAM,EAAE;YACV,OAAO,CAAC,GAAG,CAAC,GAAG,KAAK,MAAM,OAAO,EAAE,CAAC,CAAC;YACrC,OAAO,CAAC,KAAK,GAAG,KAAK,CAAC;SAEvB;aAAM;YACL,MAAM,IAAI,GAAG,IAAI,IAAI,EAAE,CAAC;YACxB,MAAM,UAAU,GACd,CAAC,IAAI,CAAC,QAAQ,EAAE,GAAG,CAAC,EAAE,IAAI,CAAC,OAAO,EAAE,EAAE,IAAI,CAAC,WAAW,EAAE,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC;gBACnE,GAAG;gBACH,CAAC,IAAI,CAAC,QAAQ,EAAE,EAAE,IAAI,CAAC,UAAU,EAAE,EAAE,IAAI,CAAC,UAAU,EAAE,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;YACpE,OAAO,CAAC,GAAG,CAAC,IAAI,UAAU,KAAK,KAAK,MAAM,OAAO,EAAE,CAAC,CAAC;SACtD;KACF;AACH,CAAC,CAAC;AAzBW,QAAA,GAAG,OAyBd"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pim-import",
|
|
3
|
-
"version": "2.79.
|
|
3
|
+
"version": "2.79.1",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "types/index.d.ts",
|
|
@@ -28,7 +28,6 @@
|
|
|
28
28
|
"typescript": "^4.2.4"
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@logdna/logger": "^2.3.2",
|
|
32
31
|
"@sentry/node": "^6.10.0",
|
|
33
32
|
"@sentry/tracing": "^6.10.0",
|
|
34
33
|
"algoliasearch": "^4.10.3",
|
package/src/libs/logs.ts
CHANGED
|
@@ -3,32 +3,32 @@ export type LogLevels = "TRACE" | "DEBUG" | "INFO" | "WARN" | "ERROR" | "FATAL";
|
|
|
3
3
|
export const logStatus = true;
|
|
4
4
|
export const logLevelToHide: LogLevels[] = []; // ["debug", "info"];
|
|
5
5
|
|
|
6
|
-
const logdna = require("@logdna/logger");
|
|
7
|
-
let logger: any = null;
|
|
6
|
+
// const logdna = require("@logdna/logger");
|
|
7
|
+
// let logger: any = null;
|
|
8
8
|
let logId = "";
|
|
9
9
|
let logOpts: ObjectPartial = {};
|
|
10
10
|
|
|
11
11
|
export const getLogger = () => {
|
|
12
|
-
if (logger) {
|
|
13
|
-
|
|
14
|
-
} else if (
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
) {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
} else {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
}
|
|
12
|
+
// if (logger) {
|
|
13
|
+
// // console.log("Logger already exists");
|
|
14
|
+
// } else if (
|
|
15
|
+
// process?.env?.FPI_LOGDNA_KEY &&
|
|
16
|
+
// process?.env?.FPI_LOGDNA_APP_NAME
|
|
17
|
+
// ) {
|
|
18
|
+
// // console.log("Set Logger");
|
|
19
|
+
// const options = {
|
|
20
|
+
// app: process.env.FPI_LOGDNA_APP_NAME,
|
|
21
|
+
// level: "debug", // set a default for when level is not provided in function calls
|
|
22
|
+
// };
|
|
23
|
+
// logger = logdna.createLogger(process.env.FPI_LOGDNA_KEY, options);
|
|
24
|
+
// logger.on("error", console.error);
|
|
25
|
+
// } else {
|
|
26
|
+
// console.log(
|
|
27
|
+
// "FPI_LOGDNA_KEY or FPI_LOGDNA_APP_NAME evironment variables not found"
|
|
28
|
+
// );
|
|
29
|
+
// }
|
|
30
30
|
|
|
31
|
-
return logger;
|
|
31
|
+
return null; //logger;
|
|
32
32
|
};
|
|
33
33
|
|
|
34
34
|
export const setLogId = (id: string) => {
|
|
@@ -45,7 +45,7 @@ export const log = (message: string, level: LogLevels = "DEBUG") => {
|
|
|
45
45
|
message = logId ? `[${logId}] - ${message}` : message;
|
|
46
46
|
if (level === "ERROR") {
|
|
47
47
|
if (Logger) {
|
|
48
|
-
Logger.error(message);
|
|
48
|
+
// Logger.error(message);
|
|
49
49
|
throw new Error(message);
|
|
50
50
|
} else {
|
|
51
51
|
throw new Error(message);
|
|
@@ -54,7 +54,7 @@ export const log = (message: string, level: LogLevels = "DEBUG") => {
|
|
|
54
54
|
if (Logger) {
|
|
55
55
|
console.log(`${level} - ${message}`);
|
|
56
56
|
logOpts.level = level;
|
|
57
|
-
Logger.log(message, logOpts);
|
|
57
|
+
// Logger.log(message, logOpts);
|
|
58
58
|
} else {
|
|
59
59
|
const date = new Date();
|
|
60
60
|
const dateFormat =
|
package/types/libs/logs.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { ObjectPartial } from "../types";
|
|
|
2
2
|
export declare type LogLevels = "TRACE" | "DEBUG" | "INFO" | "WARN" | "ERROR" | "FATAL";
|
|
3
3
|
export declare const logStatus = true;
|
|
4
4
|
export declare const logLevelToHide: LogLevels[];
|
|
5
|
-
export declare const getLogger: () =>
|
|
5
|
+
export declare const getLogger: () => null;
|
|
6
6
|
export declare const setLogId: (id: string) => void;
|
|
7
7
|
export declare const setLogOptions: (opts: ObjectPartial) => void;
|
|
8
8
|
export declare const log: (message: string, level?: LogLevels) => void;
|