@storm-stack/cli
Advanced tools
Comparing version 1.13.11 to 1.14.0
@@ -498,13 +498,6 @@ /// <reference types="node" /> | ||
DEBUG: 60 as LogLevel, | ||
TRACE: 70 as LogLevel, | ||
TRACE: 70 as LogLevel | ||
}; | ||
declare type LogLevelLabel = | ||
| "silent" | ||
| "fatal" | ||
| "error" | ||
| "warn" | ||
| "info" | ||
| "debug" | ||
| "trace"; | ||
declare type LogLevelLabel = "silent" | "fatal" | "error" | "warn" | "info" | "debug" | "trace"; | ||
@@ -518,3 +511,3 @@ declare const LogLevelLabel = { | ||
DEBUG: "debug" as LogLevelLabel, | ||
TRACE: "trace" as LogLevelLabel, | ||
TRACE: "trace" as LogLevelLabel | ||
}; | ||
@@ -1317,7 +1310,5 @@ | ||
"logging", | ||
LoggingConfigSchema, | ||
LoggingConfigSchema | ||
); | ||
StormLog.logger = StormLog.initialize( | ||
config as StormConfig<"logging", LoggingConfig>, | ||
); | ||
StormLog.logger = StormLog.initialize(config as StormConfig<"logging", LoggingConfig>); | ||
StormLog.logLevel = getLogLevel(config.logLevel); | ||
@@ -1330,3 +1321,3 @@ StormLog.logLevelLabel = config.logLevel; | ||
logLevel: StormLog.logLevel, | ||
logLevelLabel: StormLog.logLevelLabel, | ||
logLevelLabel: StormLog.logLevelLabel | ||
}; | ||
@@ -1344,3 +1335,3 @@ }; | ||
config: StormConfig<"logging", LoggingConfig>, | ||
name?: string, | ||
name?: string | ||
): Logger<LoggerOptions> => { | ||
@@ -1368,3 +1359,3 @@ const pinoLogger: Logger<LoggerOptions> = getPinoLogger(config, name); | ||
name?: string, | ||
additionalLoggers: ILoggerWrapper[] = [], | ||
additionalLoggers: ILoggerWrapper[] = [] | ||
) { | ||
@@ -1394,3 +1385,3 @@ this.#config = config; | ||
name?: string, | ||
additionalLoggers: ILoggerWrapper[] = [], | ||
additionalLoggers: ILoggerWrapper[] = [] | ||
) { | ||
@@ -1408,4 +1399,3 @@ return new StormLog(config, name, additionalLoggers); | ||
StormLog.getLoggers().then((logger) => { | ||
StormLog.logLevel >= LogLevel.INFO && | ||
logger.info({ msg: message, level: "success" }); | ||
StormLog.logLevel >= LogLevel.INFO && logger.info({ msg: message, level: "success" }); | ||
}); | ||
@@ -1424,4 +1414,3 @@ } | ||
StormLog.getLoggers().then((logger) => { | ||
StormLog.logLevel >= LogLevel.FATAL && | ||
logger.fatal({ error, level: "fatal" }); | ||
StormLog.logLevel >= LogLevel.FATAL && logger.fatal({ error, level: "fatal" }); | ||
}); | ||
@@ -1440,4 +1429,3 @@ } | ||
StormLog.getLoggers().then((logger) => { | ||
StormLog.logLevel >= LogLevel.ERROR && | ||
logger.error({ error, level: "error" }); | ||
StormLog.logLevel >= LogLevel.ERROR && logger.error({ error, level: "error" }); | ||
}); | ||
@@ -1456,4 +1444,3 @@ } | ||
StormLog.getLoggers().then((logger) => { | ||
StormLog.logLevel >= LogLevel.ERROR && | ||
logger.error({ error, level: "exception" }); | ||
StormLog.logLevel >= LogLevel.ERROR && logger.error({ error, level: "exception" }); | ||
}); | ||
@@ -1532,4 +1519,4 @@ } | ||
`⏱️ The${name ? ` ${name}` : ""} process took ${formatSince( | ||
startTime.since(), | ||
)} to complete`, | ||
startTime.since() | ||
)} to complete` | ||
); | ||
@@ -1548,5 +1535,3 @@ }); | ||
this.#logger.info({ msg: message, level: "success" }); | ||
Promise.all( | ||
this.#additionalLoggers.map((logger) => logger.success(message)), | ||
); | ||
Promise.all(this.#additionalLoggers.map((logger) => logger.success(message))); | ||
} | ||
@@ -1596,5 +1581,3 @@ } | ||
this.#logger.error({ error, level: "exception" }); | ||
Promise.all( | ||
this.#additionalLoggers.map((logger) => logger.exception(error)), | ||
); | ||
Promise.all(this.#additionalLoggers.map((logger) => logger.exception(error))); | ||
} | ||
@@ -1612,5 +1595,3 @@ } | ||
this.#logger.warn(message); | ||
Promise.all( | ||
this.#additionalLoggers.map((logger) => logger.warn(message)), | ||
); | ||
Promise.all(this.#additionalLoggers.map((logger) => logger.warn(message))); | ||
} | ||
@@ -1628,5 +1609,3 @@ } | ||
this.#logger.info(message); | ||
Promise.all( | ||
this.#additionalLoggers.map((logger) => logger.info(message)), | ||
); | ||
Promise.all(this.#additionalLoggers.map((logger) => logger.info(message))); | ||
} | ||
@@ -1644,5 +1623,3 @@ } | ||
this.#logger.debug(message); | ||
Promise.all( | ||
this.#additionalLoggers.map((logger) => logger.debug(message)), | ||
); | ||
Promise.all(this.#additionalLoggers.map((logger) => logger.debug(message))); | ||
} | ||
@@ -1660,5 +1637,3 @@ } | ||
this.#logger.trace(message); | ||
Promise.all( | ||
this.#additionalLoggers.map((logger) => logger.trace(message)), | ||
); | ||
Promise.all(this.#additionalLoggers.map((logger) => logger.trace(message))); | ||
} | ||
@@ -1709,11 +1684,7 @@ } | ||
if (!_startTime && !this.#processes.some((item) => item.name === name)) { | ||
this.warn( | ||
`No start time was provided and the ${name} process was never started`, | ||
); | ||
this.warn(`No start time was provided and the ${name} process was never started`); | ||
return; | ||
} | ||
if (name && this.#processes.some((item) => item.name === name)) { | ||
_startTime = this.#processes.find( | ||
(item) => item.name === name, | ||
)?.startedAt; | ||
_startTime = this.#processes.find((item) => item.name === name)?.startedAt; | ||
} | ||
@@ -1731,3 +1702,3 @@ | ||
0, | ||
this.#processes.findIndex((item) => item.name === process), | ||
this.#processes.findIndex((item) => item.name === process) | ||
) | ||
@@ -1758,7 +1729,3 @@ .join(" > "); | ||
public child(options: { name: string } & Record<string, any>): IStormLog { | ||
return new StormLog( | ||
this.#config, | ||
`${this.#name} ❯ ${options?.name}`, | ||
this.#additionalLoggers, | ||
); | ||
return new StormLog(this.#config, `${this.#name} ❯ ${options?.name}`, this.#additionalLoggers); | ||
} | ||
@@ -1784,5 +1751,3 @@ | ||
if (logger) { | ||
this.addWrappedLogger( | ||
LoggerWrapper.wrap(logger, this.#config.modules?.logging), | ||
); | ||
this.addWrappedLogger(LoggerWrapper.wrap(logger, this.#config.modules?.logging)); | ||
} | ||
@@ -1789,0 +1754,0 @@ } |
{ | ||
"name": "@storm-stack/cli", | ||
"version": "1.13.11", | ||
"version": "1.14.0", | ||
"private": false, | ||
@@ -5,0 +5,0 @@ "description": "A collection of CLI utilities to assist in creating command line applications.", |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
323683
1701