replace console.log with nicelog (#1496)

This PR replaces our `console.log` with `nicelog` so that I can more
easily grep for errant console.logs.

### Change Type

- [x] `internal` — Any other changes that don't affect the published
package (will not publish a new version)
This commit is contained in:
Steve Ruiz 2023-06-01 19:01:49 +01:00 committed by GitHub
parent 0c4174c0b8
commit a3c39cde4b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
22 changed files with 80 additions and 78 deletions

View file

@ -17,7 +17,7 @@ import {
import { getApiMarkdown } from './getApiMarkdown'
import { getSlug } from './utils'
const { log } = console
const { log: nicelog } = console
type InputCategory = {
id: string
@ -290,14 +290,14 @@ export async function generateContent(): Promise<GeneratedContent> {
const apiSection = await generateApiDocs()
log('• Generating site content (content.json)')
nicelog('• Generating site content (content.json)')
try {
const outputSections: Section[] = [...(sections as InputSection[]), apiSection]
.map((section) => generateSection(section, content, articles))
.filter((section) => section.categories.some((c) => c.articleIds.length > 0))
log('✔ Generated site content.')
nicelog('✔ Generated site content.')
// Write to disk
@ -310,7 +310,7 @@ export async function generateContent(): Promise<GeneratedContent> {
return contentComplete
} catch (error) {
log(`x Could not generate site content.`)
nicelog(`x Could not generate site content.`)
throw error
}