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:
@@ -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;
|
||||
};
|
||||
|
||||
@@ -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(),
|
||||
});
|
||||
|
||||
@@ -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;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user