diff --git a/src/logging/types.ts b/src/logging/types.ts index 9e6e1210..3094eaf4 100644 --- a/src/logging/types.ts +++ b/src/logging/types.ts @@ -51,6 +51,7 @@ export interface ILogItem { catch(err: Error): Error; serialize(filter: LogFilter, parentStartTime: number | undefined, forced: boolean): ISerializedItem | undefined; finish(): void; + child(labelOrValues: LabelOrValues, logLevel?: LogLevel, filterCreator?: FilterCreator): ILogItem; } export interface ILogger { diff --git a/src/matrix/net/HomeServerApi.ts b/src/matrix/net/HomeServerApi.ts index 69b86bbb..bacf26b0 100644 --- a/src/matrix/net/HomeServerApi.ts +++ b/src/matrix/net/HomeServerApi.ts @@ -21,7 +21,7 @@ import type {IHomeServerRequest} from "./HomeServerRequest"; import type {Reconnector} from "./Reconnector"; import type {EncodedBody} from "./common"; import type {IRequestOptions, RequestFunction} from "../../platform/types/types"; -import type {LogItem} from "../../logging/LogItem"; +import type {ILogItem} from "../../logging/types"; type RequestMethod = "POST" | "GET" | "PUT"; @@ -57,7 +57,7 @@ export class HomeServerApi { private _baseRequest(method: RequestMethod, url: string, queryParams?: Record, body?: Record, options?: IRequestOptions, accessToken?: string): IHomeServerRequest { const queryString = encodeQueryParams(queryParams); url = `${url}?${queryString}`; - let log: LogItem | undefined; + let log: ILogItem | undefined; if (options?.log) { const parent = options?.log; log = parent.child({ diff --git a/src/platform/types/types.ts b/src/platform/types/types.ts index f619c706..58d2216f 100644 --- a/src/platform/types/types.ts +++ b/src/platform/types/types.ts @@ -16,7 +16,7 @@ limitations under the License. import type {RequestResult} from "../web/dom/request/fetch.js"; import type {EncodedBody} from "../../matrix/net/common"; -import type {LogItem} from "../../logging/LogItem"; +import type {ILogItem} from "../../logging/types"; export interface IRequestOptions { uploadProgress?: (loadedBytes: number) => void; @@ -24,7 +24,7 @@ export interface IRequestOptions { body?: EncodedBody; headers?: Map; cache?: boolean; - log?: LogItem; + log?: ILogItem; prefix?: string; method?: string; format?: string;