mirror of
https://github.com/ajnart/homarr.git
synced 2026-02-27 00:40:58 +01:00
fix: reduce logging (#3200)
Co-authored-by: Meier Lukas <meierschlumpf@gmail.com>
This commit is contained in:
@@ -24,7 +24,7 @@ export class LoggingAgent extends Agent {
|
||||
url.searchParams.set(key, "REDACTED");
|
||||
});
|
||||
|
||||
logger.info(
|
||||
logger.debug(
|
||||
`Dispatching request ${url.toString().replaceAll("=&", "&")} (${Object.keys(options.headers ?? {}).length} headers)`,
|
||||
);
|
||||
return super.dispatch(options, handler);
|
||||
|
||||
@@ -21,7 +21,7 @@ const REDACTED = "REDACTED";
|
||||
describe("LoggingAgent should log all requests", () => {
|
||||
test("should log all requests", () => {
|
||||
// Arrange
|
||||
const infoLogSpy = vi.spyOn(logger, "info");
|
||||
const infoLogSpy = vi.spyOn(logger, "debug");
|
||||
const agent = new LoggingAgent();
|
||||
|
||||
// Act
|
||||
@@ -33,7 +33,7 @@ describe("LoggingAgent should log all requests", () => {
|
||||
|
||||
test("should show amount of headers", () => {
|
||||
// Arrange
|
||||
const infoLogSpy = vi.spyOn(logger, "info");
|
||||
const infoLogSpy = vi.spyOn(logger, "debug");
|
||||
const agent = new LoggingAgent();
|
||||
|
||||
// Act
|
||||
@@ -68,7 +68,7 @@ describe("LoggingAgent should log all requests", () => {
|
||||
[`/?stringWith13Chars=${"a".repeat(13)}`, `/?stringWith13Chars=${REDACTED}`],
|
||||
])("should redact sensitive data in url https://homarr.dev%s", (path, expected) => {
|
||||
// Arrange
|
||||
const infoLogSpy = vi.spyOn(logger, "info");
|
||||
const infoLogSpy = vi.spyOn(logger, "debug");
|
||||
const agent = new LoggingAgent();
|
||||
|
||||
// Act
|
||||
@@ -87,7 +87,7 @@ describe("LoggingAgent should log all requests", () => {
|
||||
["date times", "/?datetime=2022-01-01T00:00:00.000Z"],
|
||||
])("should not redact values that are %s", (_reason, path) => {
|
||||
// Arrange
|
||||
const infoLogSpy = vi.spyOn(logger, "info");
|
||||
const infoLogSpy = vi.spyOn(logger, "debug");
|
||||
const agent = new LoggingAgent();
|
||||
|
||||
// Act
|
||||
|
||||
@@ -28,7 +28,7 @@ const createCallback = <TAllowedNames extends string, TName extends TAllowedName
|
||||
options: CreateCronJobOptions,
|
||||
creatorOptions: CreateCronJobCreatorOptions<TAllowedNames>,
|
||||
) => {
|
||||
const expectedMaximumDurationInMillis = options.expectedMaximumDurationInMillis ?? 1000;
|
||||
const expectedMaximumDurationInMillis = options.expectedMaximumDurationInMillis ?? 2500;
|
||||
return (callback: () => MaybePromise<void>) => {
|
||||
const catchingCallbackAsync = async () => {
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user