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