Private AI meeting notes that stay on your computer. No meeting bot. Free and open source for Mac, Windows and Linux. An alternative to Granola, Otter and Fireflies.
TypeScript ai-meeting-assistantai-notetakerelectrongranola-alternativelinuxllama-cpplocal-ailocal-firstmacosmcpmeeting-minutesmeeting-notesoffline-firstopen-sourceprivacyspeech-to-texttranscriptionwhisperwhisper-cppwindows
The log keeps the file before it as main.old.log, so a morning's trouble is still there in the afternoon; the docs say where both are (#156)
christianmatedbf8a79b6c5
diff --git a/app/src/main/log.ts b/app/src/main/log.tsindex 330df9ee..c8de2a85 100644--- a/app/src/main/log.ts+++ b/app/src/main/log.ts@@ -1,4 +1,4 @@-import { appendFileSync, existsSync, mkdirSync, readFileSync, statSync, writeFileSync } from 'node:fs'+import { appendFileSync, existsSync, mkdirSync, renameSync, statSync } from 'node:fs'import { dirname } from 'node:path'import { inspect } from 'node:util'@@ -7,19 +7,23 @@ export function logLine(level: string, args: unknown[], at = new Date()): stringreturn `${at.toISOString()} ${level} ${args.map((a) => (typeof a === 'string' ? a : a instanceof Error ? a.stack ?? String(a) : inspect(a, { depth: 3 }))).join(' ')}\n`}-/** Append, keeping the file under cap bytes: past it, the older half is dropped. */-export function writeLog(file: string, line: string, cap = 2_000_000) {+/** main.log's previous file, next to it (main.old.log) */+export const oldLogFile = (file: string): string => file.replace(/(\.log)?$/, '.old$1')++/**+ * Append, keeping the file under cap bytes: past it, the file becomes main.old.log (replacing the one before) and a new+ * one starts. Two files are kept, so a morning's trouble is still there in the afternoon (#156: dropping the older half+ * of one file lost it).+ */+export function writeLog(file: string, line: string, cap = 4_000_000) {mkdirSync(dirname(file), { recursive: true })- if (existsSync(file) && statSync(file).size + line.length > cap) {- const old = readFileSync(file, 'utf8')- writeFileSync(file, old.slice(Math.max(0, old.length - Math.floor(cap / 2) + line.length)))- }+ if (existsSync(file) && statSync(file).size + line.length > cap) renameSync(file, oldLogFile(file))appendFileSync(file, line)}/**- * Warnings, errors and info (where a reply's time went) also go to a file in the profile (logs/main.log), so a problem- * on someone's computer can be looked at afterwards; nothing leaves the computer.+ * Warnings, errors and info (where a reply's time went) also go to a file in the profile (logs/main.log, and the one+ * before it, logs/main.old.log), so a problem on someone's computer can be looked at afterwards; nothing leaves the computer.*/export function logToFile(file: string) {for (const level of ['info', 'warn', 'error'] as const) {diff --git a/app/test/log.test.ts b/app/test/log.test.tsindex b153a495..c44e2cbc 100644--- a/app/test/log.test.ts+++ b/app/test/log.test.ts@@ -1,18 +1,31 @@-import { mkdtempSync, readFileSync, statSync, writeFileSync } from 'node:fs'+import { existsSync, mkdtempSync, readFileSync, statSync, writeFileSync } from 'node:fs'import { tmpdir } from 'node:os'import { join } from 'node:path'import { expect, it } from 'vitest'-import { logLine, writeLog } from '../src/main/log'+import { logLine, oldLogFile, writeLog } from '../src/main/log'it('a log line has the time, the level and the error with its stack', () => {const line = logLine('error', ['web search failed', new Error('connect ECONNREFUSED')], new Date('2026-10-22T20:00:00Z'))expect(line).toMatch(/^2026-10-22T20:00:00.000Z error web search failed Error: connect ECONNREFUSED\n\s+at /)})-it('the log file never grows past its cap: the older half goes', () => {+it('the log file never grows past its cap', () => {const file = join(mkdtempSync(join(tmpdir(), 'yogurt-log-')), 'main.log')writeFileSync(file, 'x'.repeat(900))writeLog(file, 'y'.repeat(200) + '\n', 1000)expect(statSync(file).size).toBeLessThanOrEqual(1000)expect(readFileSync(file, 'utf8').endsWith('y'.repeat(200) + '\n')).toBe(true)})++// #156: the morning's reason for leaving the graphics card was gone from main.log by the afternoon+it('past its cap the whole file is kept as main.old.log, and only the one before that goes', () => {+ const file = join(mkdtempSync(join(tmpdir(), 'yogurt-log-')), 'main.log')+ expect(oldLogFile(file)).toBe(file.replace(/main\.log$/, 'main.old.log'))+ writeFileSync(file, 'morning\n' + 'x'.repeat(990))+ writeLog(file, 'afternoon\n', 1000)+ expect(readFileSync(oldLogFile(file), 'utf8').startsWith('morning\n')).toBe(true)+ expect(readFileSync(file, 'utf8')).toBe('afternoon\n')+ writeLog(file, 'z'.repeat(995) + '\n', 1000)+ expect(readFileSync(oldLogFile(file), 'utf8')).toBe('afternoon\n')+ expect(existsSync(file)).toBe(true)+})diff --git a/docs/README.md b/docs/README.mdindex d93d7496..cf9b7868 100644--- a/docs/README.md+++ b/docs/README.md@@ -77,3 +77,5 @@ Removing the app keeps your data. To remove that too, export a backup if you wan## Report a problem[Open a GitHub issue](https://github.com/FrigadeHQ/yogurt/issues) with your operating system, Yogurt version, what you did, what you expected and what happened. Leave private meeting content out of screenshots and reports.++Yogurt keeps a log on your computer, in the `logs` folder inside the Yogurt data folder listed above: `main.log` is the newest, and `main.old.log` holds what came before it. Attaching both helps a lot.