1
0
mirror of https://github.com/lensapp/lens.git synced 2025-05-20 05:10:56 +00:00

Remove logging frameId as unnecessary

Signed-off-by: Sebastian Malton <sebastian@malton.name>
This commit is contained in:
Sebastian Malton 2023-02-24 15:42:25 -05:00
parent ae6caea65f
commit 98740c919a
4 changed files with 2 additions and 33 deletions

View File

@ -1,13 +0,0 @@
/**
* Copyright (c) OpenLens Authors. All rights reserved.
* Licensed under MIT License. See LICENSE in root directory for more information.
*/
import { getInjectable } from "@ogre-tools/injectable";
import webFrameInjectable from "./web-frame.injectable";
const frameRoutingIdInjectable = getInjectable({
id: "frame-routing-id",
instantiate: (di) => di.inject(webFrameInjectable).routingId,
});
export default frameRoutingIdInjectable;

View File

@ -1,14 +0,0 @@
/**
* Copyright (c) OpenLens Authors. All rights reserved.
* Licensed under MIT License. See LICENSE in root directory for more information.
*/
import { getInjectable } from "@ogre-tools/injectable";
import { webFrame } from "electron";
const webFrameInjectable = getInjectable({
id: "web-frame",
instantiate: () => webFrame,
causesSideEffects: true,
});
export default webFrameInjectable;

View File

@ -5,7 +5,6 @@
import { getInjectable } from "@ogre-tools/injectable"; import { getInjectable } from "@ogre-tools/injectable";
import { once } from "lodash"; import { once } from "lodash";
import prefixedLoggerInjectable from "../../../common/logger/prefixed-logger.injectable"; import prefixedLoggerInjectable from "../../../common/logger/prefixed-logger.injectable";
import frameRoutingIdInjectable from "../../../features/electron/renderer/frame-routing-id.injectable";
import clusterFrameClusterInjectable from "../../cluster-frame-context/cluster-frame-cluster.injectable"; import clusterFrameClusterInjectable from "../../cluster-frame-context/cluster-frame-cluster.injectable";
import closeRendererLogFileInjectable from "../../logger/close-renderer-log-file.injectable"; import closeRendererLogFileInjectable from "../../logger/close-renderer-log-file.injectable";
import unmountRootComponentInjectable from "../../window/unmount-root-component.injectable"; import unmountRootComponentInjectable from "../../window/unmount-root-component.injectable";
@ -14,13 +13,12 @@ const handleOnClusterFrameCloseInjectable = getInjectable({
id: "handle-on-cluster-frame-close", id: "handle-on-cluster-frame-close",
instantiate: (di) => { instantiate: (di) => {
const cluster = di.inject(clusterFrameClusterInjectable); const cluster = di.inject(clusterFrameClusterInjectable);
const frameRoutingId = di.inject(frameRoutingIdInjectable);
const logger = di.inject(prefixedLoggerInjectable, "CLUSTER-FRAME"); const logger = di.inject(prefixedLoggerInjectable, "CLUSTER-FRAME");
const closeFileLogging = di.inject(closeRendererLogFileInjectable); const closeFileLogging = di.inject(closeRendererLogFileInjectable);
const unmountRootComponent = di.inject(unmountRootComponentInjectable); const unmountRootComponent = di.inject(unmountRootComponentInjectable);
const onCloseFrame = once(() => { const onCloseFrame = once(() => {
logger.info(`Unload dashboard, clusterId=${(cluster.id)}, frameId=${frameRoutingId}`); logger.info(`Unload dashboard, clusterId=${(cluster.id)}`);
closeFileLogging(); closeFileLogging();
unmountRootComponent(); unmountRootComponent();
}); });

View File

@ -6,7 +6,6 @@ import { getInjectable } from "@ogre-tools/injectable";
import { when } from "mobx"; import { when } from "mobx";
import prefixedLoggerInjectable from "../../../common/logger/prefixed-logger.injectable"; import prefixedLoggerInjectable from "../../../common/logger/prefixed-logger.injectable";
import requestSetClusterFrameIdInjectable from "../../../features/cluster/frame-id/renderer/request-set-frame-id.injectable"; import requestSetClusterFrameIdInjectable from "../../../features/cluster/frame-id/renderer/request-set-frame-id.injectable";
import frameRoutingIdInjectable from "../../../features/electron/renderer/frame-routing-id.injectable";
import { beforeClusterFrameStartsSecondInjectionToken } from "../../before-frame-starts/tokens"; import { beforeClusterFrameStartsSecondInjectionToken } from "../../before-frame-starts/tokens";
import clusterFrameClusterInjectable from "../../cluster-frame-context/cluster-frame-cluster.injectable"; import clusterFrameClusterInjectable from "../../cluster-frame-context/cluster-frame-cluster.injectable";
@ -18,9 +17,8 @@ const waitForClusterToFinishActivatingInjectable = getInjectable({
const cluster = di.inject(clusterFrameClusterInjectable); const cluster = di.inject(clusterFrameClusterInjectable);
const requestSetClusterFrameId = di.inject(requestSetClusterFrameIdInjectable); const requestSetClusterFrameId = di.inject(requestSetClusterFrameIdInjectable);
const logger = di.inject(prefixedLoggerInjectable, "CLUSTER-FRAME"); const logger = di.inject(prefixedLoggerInjectable, "CLUSTER-FRAME");
const frameRoutingId = di.inject(frameRoutingIdInjectable);
logger.info(`Init dashboard, clusterId=${cluster.id}, frameId=${frameRoutingId}`); logger.info(`Init dashboard, clusterId=${cluster.id}`);
await requestSetClusterFrameId(cluster.id); await requestSetClusterFrameId(cluster.id);
await when(() => cluster.ready); // cluster.activate() is done at this point await when(() => cluster.ready); // cluster.activate() is done at this point