@putkoff/abstract-logger 0.0.37 → 0.0.38
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/cjs/index.js +20 -15
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/index.js +20 -15
- package/dist/esm/index.js.map +1 -1
- package/package.json +1 -1
package/dist/esm/index.js
CHANGED
|
@@ -14881,28 +14881,33 @@ function getLogString(messageOrOptions, logType = null, details = null, function
|
|
|
14881
14881
|
const finalLogType = resolvedLogType ?? "info";
|
|
14882
14882
|
const emoji = activityEmojiMap[opts.activity ?? ""] ??
|
|
14883
14883
|
"ℹ️";
|
|
14884
|
-
const
|
|
14884
|
+
const LOG_CONFIG = getLogConfig();
|
|
14885
14885
|
const condense = shouldCondense(finalLogType);
|
|
14886
14886
|
const showDetails = shouldShowDetails(finalLogType);
|
|
14887
|
+
// 👇 ADD THIS
|
|
14888
|
+
const pretty = LOG_CONFIG.prettyDetails &&
|
|
14889
|
+
!condense;
|
|
14890
|
+
const timestamp = new Date().toISOString();
|
|
14887
14891
|
if (condense) {
|
|
14888
14892
|
resolvedFileLocation = resolvedFileLocation.split("/").pop();
|
|
14889
14893
|
}
|
|
14890
|
-
|
|
14891
|
-
|
|
14892
|
-
|
|
14893
|
-
const fileName = padRight(resolvedFileLocation.trim(), COLS.file);
|
|
14894
|
-
let line = `${emojiCol}` +
|
|
14895
|
-
`[${ts}] ` +
|
|
14896
|
-
`[${fn}] ` +
|
|
14897
|
-
`${message}`;
|
|
14894
|
+
padRight(emoji, 3);
|
|
14895
|
+
padRight(timestamp, COLS.timestamp);
|
|
14896
|
+
padRight(resolvedFileLocation.trim(), COLS.file);
|
|
14898
14897
|
if (showDetails && resolvedDetails !== null && resolvedDetails !== undefined) {
|
|
14899
|
-
|
|
14900
|
-
const serialized = serializeDetails(resolvedDetails, condense, LOG_CONFIG.maxDetailsLength, LOG_CONFIG.prettyDetails // 👈 HERE
|
|
14901
|
-
);
|
|
14902
|
-
line += ` | ${serialized}`;
|
|
14898
|
+
serializeDetails(resolvedDetails, condense, LOG_CONFIG.maxDetailsLength, pretty);
|
|
14903
14899
|
}
|
|
14904
|
-
|
|
14905
|
-
|
|
14900
|
+
return getFinalLine(formatLogLine({
|
|
14901
|
+
emoji,
|
|
14902
|
+
timestamp,
|
|
14903
|
+
functionName: resolvedFunctionName,
|
|
14904
|
+
message,
|
|
14905
|
+
details: showDetails ? resolvedDetails : undefined,
|
|
14906
|
+
file: resolvedFileLocation,
|
|
14907
|
+
condense,
|
|
14908
|
+
maxDetailsLength: LOG_CONFIG.maxDetailsLength,
|
|
14909
|
+
pretty, // 👈 THIS IS THE MISSING WIRE
|
|
14910
|
+
}), finalLogType, resolvedLoggerInput);
|
|
14906
14911
|
}
|
|
14907
14912
|
|
|
14908
14913
|
export { COLS, IS_BROWSER, IS_NODE, activityEmojiMap, extractFile, formatLogLine, getCallerInfo, getFinalLine, getLogConfig, getLogString, getNodeLogger, logger, padLeft, padRight, parseList, resolveLogger, resolveValue, serializeDetails, shouldCondense, shouldShowDetails };
|