chore: change most of plugins to use LoggerService

quite a big PR for this but the changes are pretty stright forward.
hopefully gets merged before most of these plugins move to the community
repository.

Signed-off-by: Heikki Hellgren <heikki.hellgren@op.fi>
This commit is contained in:
Heikki Hellgren
2024-04-13 01:35:47 +03:00
parent 16ef9e59e5
commit d5a1fe189b
285 changed files with 975 additions and 1050 deletions
+2 -2
View File
@@ -9,7 +9,7 @@ import { DiscoveryService } from '@backstage/backend-plugin-api';
import { DocumentTypeInfo } from '@backstage/plugin-search-common';
import express from 'express';
import { HttpAuthService } from '@backstage/backend-plugin-api';
import { Logger } from 'winston';
import { LoggerService } from '@backstage/backend-plugin-api';
import { PermissionAuthorizer } from '@backstage/plugin-permission-common';
import { PermissionEvaluator } from '@backstage/plugin-permission-common';
import { SearchEngine } from '@backstage/plugin-search-backend-node';
@@ -24,7 +24,7 @@ export type RouterOptions = {
discovery?: DiscoveryService;
permissions: PermissionEvaluator | PermissionAuthorizer;
config: Config;
logger: Logger;
logger: LoggerService;
auth?: AuthService;
httpAuth?: HttpAuthService;
};
+6 -7
View File
@@ -18,19 +18,18 @@ import {
coreServices,
createBackendPlugin,
} from '@backstage/backend-plugin-api';
import { loggerToWinstonLogger } from '@backstage/backend-common';
import {
LunrSearchEngine,
RegisterCollatorParameters,
RegisterDecoratorParameters,
SearchEngine,
LunrSearchEngine,
} from '@backstage/plugin-search-backend-node';
import {
searchIndexServiceRef,
searchIndexRegistryExtensionPoint,
SearchIndexRegistryExtensionPoint,
SearchEngineRegistryExtensionPoint,
searchEngineRegistryExtensionPoint,
searchIndexRegistryExtensionPoint,
SearchIndexRegistryExtensionPoint,
searchIndexServiceRef,
} from '@backstage/plugin-search-backend-node/alpha';
import { createRouter } from './service/router';
@@ -114,7 +113,7 @@ export default createBackendPlugin({
let searchEngine = searchEngineRegistry.getSearchEngine();
if (!searchEngine) {
searchEngine = new LunrSearchEngine({
logger: loggerToWinstonLogger(logger),
logger,
});
}
@@ -133,7 +132,7 @@ export default createBackendPlugin({
permissions,
auth,
httpAuth,
logger: loggerToWinstonLogger(logger),
logger,
engine: searchEngine,
types: searchIndexService.getDocumentTypes(),
});
+3 -3
View File
@@ -15,12 +15,11 @@
*/
import express from 'express';
import { Logger } from 'winston';
import { z } from 'zod';
import {
HostDiscovery,
createLegacyAuthAdapters,
errorHandler,
HostDiscovery,
} from '@backstage/backend-common';
import { InputError } from '@backstage/errors';
import { Config } from '@backstage/config';
@@ -42,6 +41,7 @@ import {
AuthService,
DiscoveryService,
HttpAuthService,
LoggerService,
} from '@backstage/backend-plugin-api';
const jsonObjectSchema: z.ZodSchema<JsonObject> = z.lazy(() => {
@@ -68,7 +68,7 @@ export type RouterOptions = {
discovery?: DiscoveryService;
permissions: PermissionEvaluator | PermissionAuthorizer;
config: Config;
logger: Logger;
logger: LoggerService;
auth?: AuthService;
httpAuth?: HttpAuthService;
};