@fonoster/logger 0.9.12 → 0.9.22
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/envs.d.ts +1 -1
- package/dist/envs.js +2 -2
- package/dist/getEnv.d.ts +19 -1
- package/dist/getEnv.js +7 -8
- package/dist/getLogger.js +2 -2
- package/dist/index.d.ts +18 -0
- package/dist/index.js +2 -2
- package/dist/logger.d.ts +18 -0
- package/dist/logger.js +2 -2
- package/dist/types.d.ts +18 -0
- package/dist/userLogger.js +2 -2
- package/package.json +2 -2
package/dist/envs.d.ts
CHANGED
package/dist/envs.js
CHANGED
|
@@ -4,8 +4,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.transports = exports.level = exports.format = exports.fluent = void 0;
|
|
7
|
-
|
|
8
|
-
* Copyright (C)
|
|
7
|
+
/**
|
|
8
|
+
* Copyright (C) 2025 by Fonoster Inc (https://fonoster.com)
|
|
9
9
|
* http://github.com/fonoster/fonoster
|
|
10
10
|
*
|
|
11
11
|
* This file is part of Fonoster
|
package/dist/getEnv.d.ts
CHANGED
|
@@ -1,2 +1,20 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (C) 2025 by Fonoster Inc (https://fonoster.com)
|
|
3
|
+
* http://github.com/fonoster/fonoster
|
|
4
|
+
*
|
|
5
|
+
* This file is part of Fonoster
|
|
6
|
+
*
|
|
7
|
+
* Licensed under the MIT License (the "License");
|
|
8
|
+
* you may not use this file except in compliance with
|
|
9
|
+
* the License. You may obtain a copy of the License at
|
|
10
|
+
*
|
|
11
|
+
* https://opensource.org/licenses/MIT
|
|
12
|
+
*
|
|
13
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
14
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
15
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
16
|
+
* See the License for the specific language governing permissions and
|
|
17
|
+
* limitations under the License.
|
|
18
|
+
*/
|
|
19
|
+
declare function getEnv<T = string>(key: string, defaultValue?: T): T;
|
|
2
20
|
export { getEnv };
|
package/dist/getEnv.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getEnv = getEnv;
|
|
4
|
+
/**
|
|
5
|
+
* Copyright (C) 2025 by Fonoster Inc (https://fonoster.com)
|
|
4
6
|
* http://github.com/fonoster/fonoster
|
|
5
7
|
*
|
|
6
8
|
* This file is part of Fonoster
|
|
@@ -17,16 +19,13 @@
|
|
|
17
19
|
* See the License for the specific language governing permissions and
|
|
18
20
|
* limitations under the License.
|
|
19
21
|
*/
|
|
20
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
|
-
exports.getEnv = getEnv;
|
|
22
|
-
// Add a helper function that will check for a service-prefixed environment variable
|
|
23
|
-
// For example, for key "LOGS_FORMAT" it will return process.env.APISERVER_LOGS_FORMAT if exists,
|
|
24
|
-
// and fall back to process.env.LOGS_FORMAT otherwise.
|
|
25
22
|
function getEnv(key, defaultValue) {
|
|
26
23
|
// Look for any environment variable that is a service-prefixed variable (e.g. APISERVER_LOGS_FORMAT)
|
|
27
24
|
const prefixedKey = Object.keys(process.env).find((envKey) => envKey !== key && envKey.endsWith(`_${key}`));
|
|
28
25
|
if (prefixedKey !== undefined && process.env[prefixedKey] !== undefined) {
|
|
29
26
|
return process.env[prefixedKey];
|
|
30
27
|
}
|
|
31
|
-
return process.env[key] !== undefined
|
|
28
|
+
return process.env[key] !== undefined
|
|
29
|
+
? process.env[key]
|
|
30
|
+
: defaultValue;
|
|
32
31
|
}
|
package/dist/getLogger.js
CHANGED
|
@@ -15,8 +15,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
exports.getLogger = getLogger;
|
|
18
|
-
|
|
19
|
-
* Copyright (C)
|
|
18
|
+
/**
|
|
19
|
+
* Copyright (C) 2025 by Fonoster Inc (https://fonoster.com)
|
|
20
20
|
* http://github.com/fonoster/fonoster
|
|
21
21
|
*
|
|
22
22
|
* This file is part of Fonoster
|
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (C) 2025 by Fonoster Inc (https://fonoster.com)
|
|
3
|
+
* http://github.com/fonoster/fonoster
|
|
4
|
+
*
|
|
5
|
+
* This file is part of Fonoster
|
|
6
|
+
*
|
|
7
|
+
* Licensed under the MIT License (the "License");
|
|
8
|
+
* you may not use this file except in compliance with
|
|
9
|
+
* the License. You may obtain a copy of the License at
|
|
10
|
+
*
|
|
11
|
+
* https://opensource.org/licenses/MIT
|
|
12
|
+
*
|
|
13
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
14
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
15
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
16
|
+
* See the License for the specific language governing permissions and
|
|
17
|
+
* limitations under the License.
|
|
18
|
+
*/
|
|
1
19
|
import { getLogger } from "./getLogger";
|
|
2
20
|
import logger, { mute, unmute } from "./logger";
|
|
3
21
|
import { ULogType } from "./types";
|
package/dist/index.js
CHANGED
|
@@ -37,8 +37,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
37
37
|
};
|
|
38
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
39
|
exports.unmute = exports.ulogger = exports.mute = exports.getLogger = exports.default = exports.ULogType = void 0;
|
|
40
|
-
|
|
41
|
-
* Copyright (C)
|
|
40
|
+
/**
|
|
41
|
+
* Copyright (C) 2025 by Fonoster Inc (https://fonoster.com)
|
|
42
42
|
* http://github.com/fonoster/fonoster
|
|
43
43
|
*
|
|
44
44
|
* This file is part of Fonoster
|
package/dist/logger.d.ts
CHANGED
|
@@ -1,3 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (C) 2025 by Fonoster Inc (https://fonoster.com)
|
|
3
|
+
* http://github.com/fonoster/fonoster
|
|
4
|
+
*
|
|
5
|
+
* This file is part of Fonoster
|
|
6
|
+
*
|
|
7
|
+
* Licensed under the MIT License (the "License");
|
|
8
|
+
* you may not use this file except in compliance with
|
|
9
|
+
* the License. You may obtain a copy of the License at
|
|
10
|
+
*
|
|
11
|
+
* https://opensource.org/licenses/MIT
|
|
12
|
+
*
|
|
13
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
14
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
15
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
16
|
+
* See the License for the specific language governing permissions and
|
|
17
|
+
* limitations under the License.
|
|
18
|
+
*/
|
|
1
19
|
import winston from "winston";
|
|
2
20
|
declare const logger: winston.Logger;
|
|
3
21
|
declare const mute: () => void;
|
package/dist/logger.js
CHANGED
|
@@ -4,8 +4,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.unmute = exports.mute = exports.default = void 0;
|
|
7
|
-
|
|
8
|
-
* Copyright (C)
|
|
7
|
+
/**
|
|
8
|
+
* Copyright (C) 2025 by Fonoster Inc (https://fonoster.com)
|
|
9
9
|
* http://github.com/fonoster/fonoster
|
|
10
10
|
*
|
|
11
11
|
* This file is part of Fonoster
|
package/dist/types.d.ts
CHANGED
|
@@ -1,3 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (C) 2025 by Fonoster Inc (https://fonoster.com)
|
|
3
|
+
* http://github.com/fonoster/fonoster
|
|
4
|
+
*
|
|
5
|
+
* This file is part of Fonoster
|
|
6
|
+
*
|
|
7
|
+
* Licensed under the MIT License (the "License");
|
|
8
|
+
* you may not use this file except in compliance with
|
|
9
|
+
* the License. You may obtain a copy of the License at
|
|
10
|
+
*
|
|
11
|
+
* https://opensource.org/licenses/MIT
|
|
12
|
+
*
|
|
13
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
14
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
15
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
16
|
+
* See the License for the specific language governing permissions and
|
|
17
|
+
* limitations under the License.
|
|
18
|
+
*/
|
|
1
19
|
export interface ULog {
|
|
2
20
|
accessKeyId: string;
|
|
3
21
|
eventType: ULogType;
|
package/dist/userLogger.js
CHANGED
|
@@ -4,8 +4,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
|
|
8
|
-
* Copyright (C)
|
|
7
|
+
/**
|
|
8
|
+
* Copyright (C) 2025 by Fonoster Inc (https://fonoster.com)
|
|
9
9
|
* http://github.com/fonoster/fonoster
|
|
10
10
|
*
|
|
11
11
|
* This file is part of Fonoster
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fonoster/logger",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.22",
|
|
4
4
|
"description": "Logger module",
|
|
5
5
|
"author": "Pedro Sanders <psanders@fonoster.com>",
|
|
6
6
|
"homepage": "https://github.com/fonoster/fonoster#readme",
|
|
@@ -32,5 +32,5 @@
|
|
|
32
32
|
"fluent-logger": "^3.4.1",
|
|
33
33
|
"winston": "^3.13.0"
|
|
34
34
|
},
|
|
35
|
-
"gitHead": "
|
|
35
|
+
"gitHead": "3c393362218ebfdd7ec672f18553953edf37e9e3"
|
|
36
36
|
}
|