Skip to content

Commit e6f4d75

Browse files
committed
remove common logger
1 parent 8640c65 commit e6f4d75

File tree

5 files changed

+9
-86
lines changed

5 files changed

+9
-86
lines changed

backend/src/__tests__/cost-aggregation.integration.test.ts

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -116,17 +116,6 @@ describe('Cost Aggregation Integration Tests', () => {
116116
},
117117
withLoggerContext: async (context: any, fn: () => Promise<any>) => fn(),
118118
}))
119-
120-
// Mock logger for common (used by billing package)
121-
mockModule('@codebuff/common/util/logger', () => ({
122-
logger: {
123-
debug: () => {},
124-
error: () => {},
125-
info: () => {},
126-
warn: () => {},
127-
},
128-
withLoggerContext: async (context: any, fn: () => Promise<any>) => fn(),
129-
}))
130119
})
131120

132121
beforeEach(async () => {

backend/src/process-str-replace.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import { logger } from '@codebuff/common/util/logger'
21
import { createPatch } from 'diff'
32

43
import { tryToDoStringReplacementWithExtraIndentation } from './generate-diffs-prompt'
4+
import { logger } from './util/logger'
55

66
function normalizeLineEndings(params: { str: string }): string {
77
return params.str.replace(/\r\n/g, '\n')
@@ -47,7 +47,9 @@ export async function processStrReplace(params: {
4747
continue
4848
}
4949

50-
const normalizedCurrentContent = normalizeLineEndings({ str: currentContent })
50+
const normalizedCurrentContent = normalizeLineEndings({
51+
str: currentContent,
52+
})
5153
const normalizedOldStr = normalizeLineEndings({ str: oldStr })
5254
const normalizedNewStr = normalizeLineEndings({ str: newStr })
5355

common/src/util/logger.ts

Lines changed: 0 additions & 70 deletions
This file was deleted.

packages/billing/knowledge.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ Currently depends on code from the `common` package for:
2525

2626
- Database access (`common/db`)
2727
- Stripe integration (`common/util/stripe`)
28-
- Logging (`common/util/logger`)
2928
- Database schema (`common/db/schema`)
3029
- Types (`common/types/usage`)
3130
- Date utilities (`common/util/date`)

scripts/calculate-monthly-usage.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { db } from '@codebuff/common/db'
22
import * as schema from '@codebuff/common/db/schema'
3-
import { logger } from '@codebuff/common/util/logger'
3+
import { getErrorObject } from '@codebuff/common/util/error'
44
import { and, gte, lt, sql } from 'drizzle-orm'
55

66
async function calculateMonthlyUsage(month: string) {
@@ -87,7 +87,10 @@ async function calculateMonthlyUsage(month: string) {
8787
}
8888
})
8989
} catch (error) {
90-
logger.error({ error }, 'Error calculating monthly usage')
90+
console.error(
91+
{ error: getErrorObject(error) },
92+
'Error calculating monthly usage',
93+
)
9194
throw error
9295
}
9396
}

0 commit comments

Comments
 (0)