mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Remove all usages of legacy global logger
Signed-off-by: Sebastian Malton <sebastian@malton.name>
This commit is contained in:
1 parent
1456e1e597
commit
ade0775061
107 files changed
+852
-606
No files matched your search
@@ -17,12 +17,13 @@ import type { KubeObjectDetailsProps } from "../kube-object-details";
|
||||
import { getDetailsUrl } from "../kube-detail-params";
|
||||
import type { Job } from "../../../common/k8s-api/endpoints";
|
||||
import { CronJob } from "../../../common/k8s-api/endpoints";
|
||||
import logger from "../../../common/logger";
|
||||
import type { Logger } from "../../../common/logger";
|
||||
import { withInjectables } from "@ogre-tools/injectable-react";
|
||||
import type { SubscribeStores } from "../../kube-watch-api/kube-watch-api";
|
||||
import subscribeStoresInjectable from "../../kube-watch-api/subscribe-stores.injectable";
|
||||
import cronJobStoreInjectable from "./store.injectable";
|
||||
import jobStoreInjectable from "../+workloads-jobs/store.injectable";
|
||||
import loggerInjectable from "../../../common/logger.injectable";
|
||||
|
||||
export interface CronJobDetailsProps extends KubeObjectDetailsProps<CronJob> {
|
||||
}
|
||||
@@ -31,6 +32,7 @@ interface Dependencies {
|
||||
subscribeStores: SubscribeStores;
|
||||
jobStore: JobStore;
|
||||
cronJobStore: CronJobStore;
|
||||
logger: Logger;
|
||||
}
|
||||
|
||||
@observer
|
||||
@@ -51,7 +53,7 @@ class NonInjectedCronJobDetails extends React.Component<CronJobDetailsProps & De
|
||||
}
|
||||
|
||||
if (!(cronJob instanceof CronJob)) {
|
||||
logger.error("[CronJobDetails]: passed object that is not an instanceof CronJob", cronJob);
|
||||
this.props.logger.error("[CronJobDetails]: passed object that is not an instanceof CronJob", cronJob);
|
||||
|
||||
return null;
|
||||
}
|
||||
@@ -123,5 +125,6 @@ export const CronJobDetails = withInjectables<Dependencies, CronJobDetailsProps>
|
||||
subscribeStores: di.inject(subscribeStoresInjectable),
|
||||
cronJobStore: di.inject(cronJobStoreInjectable),
|
||||
jobStore: di.inject(jobStoreInjectable),
|
||||
logger: di.inject(loggerInjectable),
|
||||
}),
|
||||
});
|
||||
@@ -7,6 +7,7 @@ import assert from "assert";
|
||||
import getJobsByOwnerInjectable from "../+workloads-jobs/get-jobs-by-owner.injectable";
|
||||
import { kubeObjectStoreInjectionToken } from "../../../common/k8s-api/api-manager/manager.injectable";
|
||||
import cronJobApiInjectable from "../../../common/k8s-api/endpoints/cron-job.api.injectable";
|
||||
import loggerInjectable from "../../../common/logger.injectable";
|
||||
import clusterFrameContextForNamespacedResourcesInjectable from "../../cluster-frame-context/for-namespaced-resources.injectable";
|
||||
import storesAndApisCanBeCreatedInjectable from "../../stores-apis-can-be-created.injectable";
|
||||
import { CronJobStore } from "./store";
|
||||
@@ -21,6 +22,7 @@ const cronJobStoreInjectable = getInjectable({
|
||||
return new CronJobStore({
|
||||
getJobsByOwner: di.inject(getJobsByOwnerInjectable),
|
||||
context: di.inject(clusterFrameContextForNamespacedResourcesInjectable),
|
||||
logger: di.inject(loggerInjectable),
|
||||
}, api);
|
||||
},
|
||||
injectionToken: kubeObjectStoreInjectionToken,
|
||||
|
||||
Reference in new issue
Block a user