Skip to content

Commit af619f1

Browse files
committed
idek anymore
1 parent 3ed5691 commit af619f1

File tree

5 files changed

+12
-69
lines changed

5 files changed

+12
-69
lines changed

packages/rpc/src/routers/funnels.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { chQuery, funnelDefinitions } from '@databuddy/db';
2-
import { discordLogger as logger } from '@databuddy/shared';
2+
import { logger } from '@databuddy/shared';
33
import { TRPCError } from '@trpc/server';
44
import { and, desc, eq, isNull, sql } from 'drizzle-orm';
55
import { z } from 'zod/v4';

packages/rpc/src/utils/auth.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ const getWebsiteById = cacheable(
1717
where: eq(websites.id, id),
1818
});
1919
} catch (error) {
20-
logger.error('Error fetching website by ID:', { error, id });
20+
logger.error('Error fetching website by ID:', error as Error, { id });
2121
return null;
2222
}
2323
},

packages/rpc/src/utils/billing.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,10 @@ async function _getOrganizationOwnerId(
5959
});
6060
return orgMember?.userId || null;
6161
} catch (error) {
62-
logger.error('[Billing Util] Error with _getOrganizationOwnerId:', {
63-
error,
64-
});
62+
logger.error(
63+
'[Billing Util] Error with _getOrganizationOwnerId:',
64+
error as Error
65+
);
6566
return null;
6667
}
6768
}

packages/shared/src/utils/discord-webhook.ts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
* Discord Webhook Utility
33
* Manages sending messages and logs to Discord channels via webhooks
44
*/
5-
import { logger } from './logger';
65

76
export interface DiscordEmbed {
87
title?: string;
@@ -287,7 +286,7 @@ class DiscordWebhook {
287286
});
288287

289288
if (!response.ok) {
290-
logger.error(
289+
console.error(
291290
`Discord webhook failed: ${response.status} ${response.statusText}`
292291
);
293292
resolve(false);
@@ -296,7 +295,7 @@ class DiscordWebhook {
296295

297296
resolve(true);
298297
} catch (error) {
299-
logger.error('Discord webhook error:', error);
298+
console.error('Discord webhook error:', error);
300299
resolve(false);
301300
}
302301
});
@@ -319,8 +318,9 @@ class DiscordWebhook {
319318
const task = this.rateLimitQueue.shift();
320319
if (task) {
321320
task();
321+
// Discord rate limit: 5 requests per 2 seconds
322322
setTimeout(() => {
323-
logger.info('Discord webhook rate limit timeout');
323+
console.log('Discord webhook rate limit timeout');
324324
}, 400);
325325
}
326326
}
@@ -475,7 +475,8 @@ initializeDiscordWebhook(DATABUDDY_WEBHOOK_URL, {
475475
defaultUsername: 'DataBuddy',
476476
});
477477

478-
export const discordLogger = {
478+
// Export ready-to-use logger instance
479+
export const logger = {
479480
info: (title: string, message: string, metadata?: Record<string, unknown>) =>
480481
dataBuddyWebhook.logInfo(title, message, metadata),
481482
success: (

packages/shared/src/utils/logger.ts

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

0 commit comments

Comments
 (0)