@quvel-kit/core 1.3.0 → 1.3.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/utils/logging.js +3 -3
- package/package.json +1 -1
package/dist/utils/logging.js
CHANGED
|
@@ -5,12 +5,12 @@ import { LogLevel as LogLevelEnum, LoggerType as LoggerTypeEnum } from '../types
|
|
|
5
5
|
* Create a logger instance based on configuration
|
|
6
6
|
*/
|
|
7
7
|
export function createLogger(config) {
|
|
8
|
-
const loggerType = import.meta.env
|
|
8
|
+
const loggerType = import.meta.env?.VITE_LOGGER || LoggerTypeEnum.NULL;
|
|
9
9
|
const logLevel = getLogLevel();
|
|
10
10
|
const traceInfo = config?.trace ?? {
|
|
11
11
|
id: '',
|
|
12
12
|
timestamp: new Date().toISOString(),
|
|
13
|
-
environment: import.meta.env
|
|
13
|
+
environment: import.meta.env?.MODE || 'development',
|
|
14
14
|
tenant: null,
|
|
15
15
|
runtime: 'client',
|
|
16
16
|
};
|
|
@@ -40,7 +40,7 @@ export const LOG_LEVEL_PRIORITY = {
|
|
|
40
40
|
* Defaults to INFO if not specified or invalid
|
|
41
41
|
*/
|
|
42
42
|
export function getLogLevel() {
|
|
43
|
-
const configLevel = import.meta.env
|
|
43
|
+
const configLevel = import.meta.env?.VITE_LOG_LEVEL?.toLowerCase();
|
|
44
44
|
if (configLevel && Object.values(LogLevelEnum).includes(configLevel)) {
|
|
45
45
|
return configLevel;
|
|
46
46
|
}
|