🏷️ Search for custom tailnet name offers with keywords.
1type LogSeverity = 'INFO' | 'WARNING' | 'DEBUG' | 'ERROR';
2type LogCategory =
3 | 'Alarms'
4 | 'Notifications'
5 | 'Cookies'
6 | 'Tokens'
7 | 'Eligibility'
8 | 'Offers'
9 | 'Storage'
10 | 'Messaging'
11 | 'Setup'
12 | 'General';
13
14const severityEmoji: Record<LogSeverity, string> = {
15 INFO: 'ℹ️',
16 WARNING: '⚠️',
17 DEBUG: '🐛',
18 ERROR: '❌',
19};
20
21export const log = (
22 message: string,
23 severity: LogSeverity = 'INFO',
24 category: LogCategory = 'General',
25) => {
26 const timestamp = new Date().toLocaleTimeString();
27 const emoji = severityEmoji[severity] || '';
28 console.log(
29 `${emoji} [${timestamp}] [${severity}] [${category}]: ${message}`,
30 );
31};