Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"repository": {
"url": "git+https://github.com/Digital-Alchemy-TS/core"
},
"version": "25.5.3",
"version": "25.6.1",
"author": {
"url": "https://github.com/zoe-codez",
"name": "Zoe Codez"
Expand Down
37 changes: 21 additions & 16 deletions src/services/logger.service.mts
Original file line number Diff line number Diff line change
Expand Up @@ -192,8 +192,6 @@ export async function Logger({
const highlighted = chalk.bold[METHOD_COLORS.get(key)](`[${data.context || context}]`);
const timestamp = chalk.white(`[${dayjs().format(timestampFormat)}]`);
let message = `${ms}${timestamp} ${level}${highlighted}`;
delete data.context;
delete data.name;

if (!is.empty(data.name)) {
message += chalk.blue(` (${String(data.name)})`);
Expand All @@ -202,21 +200,28 @@ export async function Logger({
if (!is.empty(prettyMessage)) {
message += `: ${chalk.cyan(prettyMessage)}`;
}

if (!is.empty(data)) {
message +=
"\n" +
inspect(data, {
compact: false,
depth: 10,
numericSeparator: true,
sorted: true,
})
.split("\n")
.slice(SYMBOL_START, SYMBOL_END)
.join("\n");
{
const {
// eslint-disable-next-line @typescript-eslint/no-unused-vars
name,
// eslint-disable-next-line sonarjs/no-unused-vars, @typescript-eslint/no-unused-vars
context: ctx,
Comment thread
zoe-codez marked this conversation as resolved.
...extra
} = data;
if (!is.empty(extra)) {
message +=
"\n" +
inspect(extra, {
compact: false,
depth: 10,
numericSeparator: true,
sorted: true,
})
.split("\n")
.slice(SYMBOL_START, SYMBOL_END)
.join("\n");
}
}

if (child) {
child[key](message);
return;
Expand Down