Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Anything Llm
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mirrored_repos
MachineLearning
Mintplex Labs
Anything Llm
Commits
f1552965
Commit
f1552965
authored
8 months ago
by
timothycarambat
Browse files
Options
Downloads
Patches
Plain Diff
patch logger for full logs
parent
cec1a3d5
No related branches found
Branches containing commit
Tags
@llamaindex/experimental@0.0.32
llamaindex@0.3.15
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
collector/utils/logger/index.js
+20
-9
20 additions, 9 deletions
collector/utils/logger/index.js
server/utils/logger/index.js
+20
-9
20 additions, 9 deletions
server/utils/logger/index.js
with
40 additions
and
18 deletions
collector/utils/logger/index.js
+
20
−
9
View file @
f1552965
...
...
@@ -30,17 +30,28 @@ class Logger {
],
});
console
.
log
=
function
()
{
return
logger
.
info
.
apply
(
logger
,
arguments
);
function
formatArgs
(
args
)
{
return
args
.
map
((
arg
)
=>
{
if
(
arg
instanceof
Error
)
{
return
arg
.
stack
;
// If argument is an Error object, return its stack trace
}
else
if
(
typeof
arg
===
"
object
"
)
{
return
JSON
.
stringify
(
arg
);
// Convert objects to JSON string
}
else
{
return
arg
;
// Otherwise, return as-is
}
})
.
join
(
"
"
);
}
console
.
log
=
function
(...
args
)
{
logger
.
info
(
formatArgs
(
args
));
};
console
.
error
=
function
()
{
if
(
arguments
.
length
>
0
&&
arguments
[
0
]
instanceof
Error
)
{
return
logger
.
error
(
arguments
[
0
].
stack
);
}
return
logger
.
error
.
apply
(
logger
,
arguments
);
console
.
error
=
function
(...
args
)
{
logger
.
error
(
formatArgs
(
args
));
};
console
.
info
=
function
()
{
return
logger
.
warn
.
apply
(
logger
,
arguments
);
console
.
info
=
function
(
...
args
)
{
logger
.
warn
(
formatArgs
(
args
)
);
};
return
logger
;
}
...
...
This diff is collapsed.
Click to expand it.
server/utils/logger/index.js
+
20
−
9
View file @
f1552965
...
...
@@ -28,17 +28,28 @@ class Logger {
],
});
console
.
log
=
function
()
{
return
logger
.
info
.
apply
(
logger
,
arguments
);
function
formatArgs
(
args
)
{
return
args
.
map
((
arg
)
=>
{
if
(
arg
instanceof
Error
)
{
return
arg
.
stack
;
// If argument is an Error object, return its stack trace
}
else
if
(
typeof
arg
===
"
object
"
)
{
return
JSON
.
stringify
(
arg
);
// Convert objects to JSON string
}
else
{
return
arg
;
// Otherwise, return as-is
}
})
.
join
(
"
"
);
}
console
.
log
=
function
(...
args
)
{
logger
.
info
(
formatArgs
(
args
));
};
console
.
error
=
function
()
{
if
(
arguments
.
length
>
0
&&
arguments
[
0
]
instanceof
Error
)
{
return
logger
.
error
(
arguments
[
0
].
stack
);
}
return
logger
.
error
.
apply
(
logger
,
arguments
);
console
.
error
=
function
(...
args
)
{
logger
.
error
(
formatArgs
(
args
));
};
console
.
info
=
function
()
{
return
logger
.
warn
.
apply
(
logger
,
arguments
);
console
.
info
=
function
(
...
args
)
{
logger
.
warn
(
formatArgs
(
args
)
);
};
return
logger
;
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment