@@ -20,6 +20,8 @@ import { deprecated, supported } from '@/versions/lib/enterprise-server-releases
2020import { allPlatforms } from '@/tools/lib/all-platforms'
2121import type { Context , FrontmatterVersions , FeaturedLinksExpanded } from '@/types'
2222import type { Product } from '@/products/lib/all-products'
23+ import { createLogger } from '@/observability/logger'
24+ const logger = createLogger ( import . meta. url )
2325
2426const isProduction = process . env . NODE_ENV === 'production'
2527
@@ -192,17 +194,18 @@ class Page {
192194 } as PageReadResult
193195 } catch ( err ) {
194196 if ( err instanceof Error && ( err as NodeJS . ErrnoException ) . code === 'ENOENT' ) return false
195- console . error ( err )
197+ logger . error ( 'Failed to read page file' , { error : err , fullPath } )
196198 return false
197199 }
198200 }
199201
200202 constructor ( opts : PageReadResult ) {
201203 if ( opts . frontmatterErrors && opts . frontmatterErrors . length ) {
202- console . error (
203- `${ opts . frontmatterErrors . length } frontmatter errors trying to load ${ opts . fullPath } :` ,
204- )
205- console . error ( opts . frontmatterErrors )
204+ logger . error ( 'Frontmatter errors loading page' , {
205+ errorCount : opts . frontmatterErrors . length ,
206+ fullPath : opts . fullPath ,
207+ frontmatterErrors : opts . frontmatterErrors ,
208+ } )
206209 throw new FrontmatterErrorsError (
207210 `${ opts . frontmatterErrors . length } frontmatter errors in ${ opts . fullPath } ` ,
208211 opts . frontmatterErrors ,
0 commit comments