Skip to content

Commit 4ec9185

Browse files
authored
Migrate src/github-apps console statements to structured logger (#61075)
1 parent c6caeef commit 4ec9185

2 files changed

Lines changed: 3 additions & 7 deletions

File tree

eslint.config.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,6 @@ export default [
180180
'src/dev-toc/**/*.{ts,js}',
181181
'src/events/components/**/*.{ts,js}',
182182
'src/fixtures/**/*.{ts,js}',
183-
'src/github-apps/**/*.{ts,js}',
184183
'src/journeys/**/*.{ts,js}',
185184
'src/languages/**/*.{ts,js}',
186185
'src/links/**/*.{ts,js}',

src/github-apps/lib/index.ts

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import fs from 'fs'
33
import type { GetServerSidePropsContext } from 'next'
44

55
import { readCompressedJsonFileFallback } from '@/frame/lib/read-json-file'
6+
import { createLogger } from '@/observability/logger'
67
import { getOpenApiVersion } from '@/versions/lib/all-versions'
78
import { categoriesWithoutSubcategories } from '../../rest/lib/index'
89
import type { Context, ExtendedRequest } from '@/types'
@@ -15,7 +16,7 @@ interface AppsConfig {
1516
// are expected to provide the concrete shape via the generic parameter.
1617
type AppsData = Record<string, unknown>
1718

18-
const DEBUG = process.env.RUNNER_DEBUG === '1' || process.env.DEBUG === '1'
19+
const logger = createLogger(import.meta.url)
1920
const ENABLED_APPS_DIR = 'src/github-apps/data'
2021
const githubAppsData = new Map<string, Map<string, AppsData>>()
2122

@@ -33,11 +34,7 @@ export async function getAppsData<T extends AppsData = AppsData>(
3334
docsVersion: string,
3435
apiVersion?: string,
3536
): Promise<T> {
36-
if (DEBUG) {
37-
console.log(
38-
`[DEBUG] getAppsData: ROOT=${process.env.ROOT || '(not set)'}, path=${ENABLED_APPS_DIR}`,
39-
)
40-
}
37+
logger.debug('getAppsData', { root: process.env.ROOT || '(not set)', path: ENABLED_APPS_DIR })
4138

4239
const pageTypeMap = githubAppsData.get(pageType)!
4340
const filename = `${pageType}.json`

0 commit comments

Comments
 (0)