MCPcopy Index your code
hub / github.com/massCodeIO/massCode / log

Function log

src/main/utils/index.ts:4–15  ·  view source on GitHub ↗
(context: string, error: unknown)

Source from the content-addressed store, hash-verified

2import fs from 'fs-extra'
3
4export function log(context: string, error: unknown): void {
5 const message = error instanceof Error ? error.message : String(error)
6 const stack = error instanceof Error ? error.stack : undefined
7
8 console.error(`[${context}] ${message}`, error)
9
10 BrowserWindow.getFocusedWindow()?.webContents.send('system:error', {
11 context,
12 message,
13 stack,
14 })
15}
16
17export function importEsm(specifier: string) {
18 // eslint-disable-next-line no-new-func

Callers 9

index.tsFile · 0.90
runUpdateCheckFunction · 0.90
checkForUpdatesFromMenuFunction · 0.90
checkForUpdatesFunction · 0.90
scheduleStateSyncFunction · 0.90
startMarkdownWatcherFunction · 0.90
openThemesDirFunction · 0.90
startThemeWatcherFunction · 0.90
useDBFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected