hazo_logs 1.0.6 → 1.0.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -78,7 +78,8 @@ import { createLogApiHandler } from 'hazo_logs/ui/server';
78
78
 
79
79
  const handler = createLogApiHandler();
80
80
 
81
- export const { GET } = handler;
81
+ // GET for log viewer, POST for client-side logging
82
+ export const { GET, POST } = handler;
82
83
  ```
83
84
 
84
85
  **2. Create UI page** (`app/logs/page.tsx`):
@@ -116,35 +117,74 @@ Visit `/logs` in your app to view logs!
116
117
 
117
118
  ### Client-Side Logging (Browser)
118
119
 
119
- For logging from client components (browser), use the client logger:
120
+ For logging from client components (browser), use the client logger.
121
+
122
+ **1. Configure global defaults (recommended):**
123
+
124
+ Set up global configuration once at app initialization. This ensures all client loggers (including those from dependency packages) use the correct API endpoint:
125
+
126
+ ```typescript
127
+ // app/providers.tsx or lib/hazo-init.ts
128
+ 'use client';
129
+ import { configureClientLogger } from 'hazo_logs/ui';
130
+
131
+ // Configure once at app startup
132
+ configureClientLogger({
133
+ apiBasePath: '/api/logs', // Required: your log API endpoint
134
+ minLevel: 'info', // Optional: minimum log level
135
+ });
136
+ ```
137
+
138
+ **2. Create loggers in your components:**
120
139
 
121
140
  ```typescript
122
141
  'use client';
123
142
  import { createClientLogger } from 'hazo_logs/ui';
124
143
 
144
+ // No need to specify apiBasePath - inherits from global config
125
145
  const logger = createClientLogger({
126
146
  packageName: 'my-app-client',
127
- apiBasePath: '/api/logs',
128
147
  });
129
148
 
130
149
  logger.info('User clicked button', { buttonId: 'submit' });
131
150
  logger.error('Failed to load data', { error: err.message });
132
151
  ```
133
152
 
153
+ **Why use global configuration?**
154
+
155
+ - Dependency packages (like `hazo_collab_forms`) automatically use your configured endpoint
156
+ - Avoids 404 errors from loggers using the wrong default path
157
+ - Single place to configure all client logging settings
158
+
134
159
  ## Important Notes
135
160
 
136
- ### Server-Only Core Logger
161
+ ### Server/Client Import Paths
162
+
163
+ hazo_logs provides different import paths for different environments:
137
164
 
138
- The main `hazo_logs` import uses Node.js APIs (`fs`, `async_hooks`) and **cannot be imported in client components**. If you try to import it in a client component, you'll get build errors.
165
+ | Import Path | Environment | Use Case |
166
+ |-------------|-------------|----------|
167
+ | `hazo_logs` | Universal | Basic logging (console on client, file on server) |
168
+ | `hazo_logs/server` | Server-only | Full logging with context, sessions, log reader |
169
+ | `hazo_logs/ui` | Client | React components, `createClientLogger()` |
170
+ | `hazo_logs/ui/server` | Server-only | API handlers for log viewer |
139
171
 
140
172
  ```typescript
141
- // Server components, API routes, middleware - OK
173
+ // Universal - works everywhere (recommended for libraries)
142
174
  import { createLogger } from 'hazo_logs';
143
175
 
144
- // Client components - use client logger instead
176
+ // Server-only - full capabilities (file logging, context, sessions)
177
+ import { createLogger, runWithLogContext } from 'hazo_logs/server';
178
+
179
+ // Client components - sends logs to server API
145
180
  import { createClientLogger } from 'hazo_logs/ui';
181
+
182
+ // API routes - create log viewer endpoints
183
+ import { createLogApiHandler } from 'hazo_logs/ui/server';
146
184
  ```
147
185
 
186
+ **Note**: The `hazo_logs/server` and `hazo_logs/ui/server` imports use the `server-only` package and will throw an error if accidentally imported in client bundles. This prevents Next.js build errors from Node.js APIs (`fs`, `async_hooks`) being bundled for the browser.
187
+
148
188
  ### Tailwind CSS Setup Required
149
189
 
150
190
  The log viewer UI uses dynamic Tailwind classes that would be purged during build. You **must** configure both:
@@ -182,11 +222,10 @@ export default {
182
222
 
183
223
  ### Session and Reference Tracking
184
224
 
185
- Track logs across async operations:
225
+ Track logs across async operations (server-only feature):
186
226
 
187
227
  ```typescript
188
- import { createLogger } from 'hazo_logs';
189
- import { runWithLogContext } from 'hazo_logs';
228
+ import { createLogger, runWithLogContext } from 'hazo_logs/server';
190
229
 
191
230
  const logger = createLogger('auth');
192
231
 
@@ -344,6 +383,40 @@ Read logs from files with filtering and pagination (server-side only).
344
383
 
345
384
  ### UI Exports (`hazo_logs/ui`)
346
385
 
386
+ #### `configureClientLogger(config: ClientLoggerGlobalConfig): void`
387
+
388
+ Configure global defaults for all client loggers. Call once at app initialization.
389
+
390
+ ```typescript
391
+ configureClientLogger({
392
+ apiBasePath: '/api/logs', // Required
393
+ minLevel: 'info', // Optional
394
+ consoleOutput: true, // Optional
395
+ batchMode: false, // Optional
396
+ batchInterval: 5000, // Optional (ms)
397
+ });
398
+ ```
399
+
400
+ #### `getClientLoggerConfig(): ClientLoggerGlobalConfig | undefined`
401
+
402
+ Get current global configuration (returns undefined if not configured).
403
+
404
+ #### `isClientLoggerConfigured(): boolean`
405
+
406
+ Check if global configuration has been set.
407
+
408
+ #### `createClientLogger(config?: ClientLoggerConfig): ClientLogger`
409
+
410
+ Create a client-side logger. Inherits from global config if set.
411
+
412
+ ```typescript
413
+ const logger = createClientLogger({
414
+ packageName: 'my-component', // Tag for this logger
415
+ sessionId: 'sess_123', // Optional session tracking
416
+ reference: 'user_456', // Optional reference tracking
417
+ });
418
+ ```
419
+
347
420
  #### `LogViewerPage`
348
421
 
349
422
  Main log viewer component.
@@ -374,7 +447,8 @@ Create Next.js API route handler.
374
447
  **Returns:**
375
448
  ```typescript
376
449
  {
377
- GET: (request: Request) => Promise<Response>
450
+ GET: (request: Request) => Promise<Response>, // Log viewer queries
451
+ POST: (request: Request) => Promise<Response>, // Client-side log ingestion
378
452
  }
379
453
  ```
380
454
 
@@ -448,11 +522,15 @@ cp node_modules/hazo_logs/config/hazo_logs_config.example.ini config/hazo_logs_c
448
522
  ### Import errors in client components
449
523
 
450
524
  ```
451
- Error: fs is not defined
452
- Error: async_hooks is not defined
525
+ Error: Module not found: Can't resolve 'async_hooks'
526
+ Error: Module not found: Can't resolve 'fs'
453
527
  ```
454
528
 
455
- The core `hazo_logs` import is server-only. Use `createClientLogger` from `hazo_logs/ui` for browser logging.
529
+ This happens when server-only code is imported in client components. Solutions:
530
+
531
+ 1. **For logging in client components**: Use `createClientLogger` from `hazo_logs/ui`
532
+ 2. **For server-only modules**: Import from `hazo_logs/server` instead of `hazo_logs`
533
+ 3. **For universal code**: The base `hazo_logs` import now works on both client and server (returns console logger on client)
456
534
 
457
535
  ### hazo_ui missing errors
458
536
 
@@ -462,6 +540,24 @@ The log viewer UI requires `hazo_ui` package. Install it:
462
540
  npm install hazo_ui
463
541
  ```
464
542
 
543
+ ### POST /api/logs 404 errors
544
+
545
+ If you see repeated `POST /api/logs 404` errors, client loggers are using the default endpoint which doesn't match your API route location.
546
+
547
+ **Solution**: Configure the global client logger at app startup:
548
+
549
+ ```typescript
550
+ // app/providers.tsx or lib/hazo-init.ts
551
+ 'use client';
552
+ import { configureClientLogger } from 'hazo_logs/ui';
553
+
554
+ configureClientLogger({
555
+ apiBasePath: '/api/hazo_logs/logs', // Match your actual route
556
+ });
557
+ ```
558
+
559
+ This ensures all client loggers (including those from dependency packages) use the correct endpoint.
560
+
465
561
  ## Contributing
466
562
 
467
563
  Contributions are welcome! Please:
package/dist/index.d.ts CHANGED
@@ -1,32 +1,37 @@
1
1
  /**
2
- * hazo_logs - Winston logger wrapper with singleton pattern
2
+ * hazo_logs - Universal logging library for hazo packages
3
3
  *
4
- * ⚠️ SERVER-ONLY: This module uses Node.js APIs (fs, async_hooks) and CANNOT be
5
- * imported in client components. For client-side logging, use:
6
- * import { createClientLogger } from 'hazo_logs/ui';
4
+ * This root export is SAFE for both server and client environments.
7
5
  *
8
- * Usage:
9
- * import { createLogger, runWithLogContext } from 'hazo_logs';
6
+ * ## Quick Start
10
7
  *
11
- * const logger = createLogger('my_package');
8
+ * ```typescript
9
+ * import { createLogger } from 'hazo_logs';
12
10
  *
13
- * // Basic logging
14
- * logger.info('Hello world', { key: 'value' });
11
+ * const logger = createLogger('my_app');
12
+ * logger.info('Application started');
13
+ * ```
15
14
  *
16
- * // With context (session/user tracking)
17
- * runWithLogContext({ sessionId: 'sess_123', reference: 'user_42' }, () => {
18
- * logger.info('User action'); // automatically includes sessionId and reference
19
- * });
15
+ * ## Environment-Specific Imports
20
16
  *
21
- * For UI components (requires Next.js, React, and hazo_ui):
22
- * import { LogViewerPage } from 'hazo_logs/ui';
23
- * import { createLogApiHandler } from 'hazo_logs/ui/server';
17
+ * ### Server-Only (full capabilities)
18
+ * For file logging, AsyncLocalStorage context, log reading:
19
+ * ```typescript
20
+ * import { createLogger, runWithLogContext, readLogs } from 'hazo_logs/server';
21
+ * ```
22
+ *
23
+ * ### Client Components (sends logs to server API)
24
+ * For logging that persists to server:
25
+ * ```typescript
26
+ * import { createClientLogger } from 'hazo_logs/ui';
27
+ * ```
28
+ *
29
+ * ### UI Components (log viewer)
30
+ * ```typescript
31
+ * import { LogViewerPage } from 'hazo_logs/ui';
32
+ * import { createLogApiHandler } from 'hazo_logs/ui/server';
33
+ * ```
24
34
  */
25
- export { HazoLogger } from './lib/hazo_logger.js';
26
- export { PackageLogger, createLogger } from './lib/package_logger.js';
27
- export { loadConfig } from './lib/config_loader.js';
28
- export { generateSessionId, startSession, startSessionAsync, runWithLogContext, runWithLogContextAsync, getLogContext, withSession, withContext, } from './lib/context/log-context.js';
29
- export { readLogs, getAvailableLogDates, getUniquePackages, getUniqueExecutionIds, getUniqueSessionIds, getUniqueReferences, } from './lib/log-reader.js';
30
- export type { Logger, LogLevel, LogData, LogEntry, LogContext, HazoLogConfig, PackageLoggerOptions, } from './lib/types.js';
31
- export type { ReadLogsOptions, LogQueryResult } from './lib/log-reader.js';
35
+ export { createLogger, createLoggerAsync, preloadServerLogger, ConsoleLogger, } from './lib/universal-logger.js';
36
+ export type { Logger, LogLevel, LogData, LogEntry, LogContext, HazoLogConfig, PackageLoggerOptions, LogSource, } from './lib/types.js';
32
37
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAGH,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACtE,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAGpD,OAAO,EACL,iBAAiB,EACjB,YAAY,EACZ,iBAAiB,EACjB,iBAAiB,EACjB,sBAAsB,EACtB,aAAa,EACb,WAAW,EACX,WAAW,GACZ,MAAM,8BAA8B,CAAC;AAGtC,OAAO,EACL,QAAQ,EACR,oBAAoB,EACpB,iBAAiB,EACjB,qBAAqB,EACrB,mBAAmB,EACnB,mBAAmB,GACpB,MAAM,qBAAqB,CAAC;AAG7B,YAAY,EACV,MAAM,EACN,QAAQ,EACR,OAAO,EACP,QAAQ,EACR,UAAU,EACV,aAAa,EACb,oBAAoB,GACrB,MAAM,gBAAgB,CAAC;AAExB,YAAY,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AAGH,OAAO,EACL,YAAY,EACZ,iBAAiB,EACjB,mBAAmB,EACnB,aAAa,GACd,MAAM,2BAA2B,CAAC;AAGnC,YAAY,EACV,MAAM,EACN,QAAQ,EACR,OAAO,EACP,QAAQ,EACR,UAAU,EACV,aAAa,EACb,oBAAoB,EACpB,SAAS,GACV,MAAM,gBAAgB,CAAC"}
package/dist/index.js CHANGED
@@ -1,33 +1,37 @@
1
1
  /**
2
- * hazo_logs - Winston logger wrapper with singleton pattern
2
+ * hazo_logs - Universal logging library for hazo packages
3
3
  *
4
- * ⚠️ SERVER-ONLY: This module uses Node.js APIs (fs, async_hooks) and CANNOT be
5
- * imported in client components. For client-side logging, use:
6
- * import { createClientLogger } from 'hazo_logs/ui';
4
+ * This root export is SAFE for both server and client environments.
7
5
  *
8
- * Usage:
9
- * import { createLogger, runWithLogContext } from 'hazo_logs';
6
+ * ## Quick Start
10
7
  *
11
- * const logger = createLogger('my_package');
8
+ * ```typescript
9
+ * import { createLogger } from 'hazo_logs';
12
10
  *
13
- * // Basic logging
14
- * logger.info('Hello world', { key: 'value' });
11
+ * const logger = createLogger('my_app');
12
+ * logger.info('Application started');
13
+ * ```
15
14
  *
16
- * // With context (session/user tracking)
17
- * runWithLogContext({ sessionId: 'sess_123', reference: 'user_42' }, () => {
18
- * logger.info('User action'); // automatically includes sessionId and reference
19
- * });
15
+ * ## Environment-Specific Imports
20
16
  *
21
- * For UI components (requires Next.js, React, and hazo_ui):
22
- * import { LogViewerPage } from 'hazo_logs/ui';
23
- * import { createLogApiHandler } from 'hazo_logs/ui/server';
17
+ * ### Server-Only (full capabilities)
18
+ * For file logging, AsyncLocalStorage context, log reading:
19
+ * ```typescript
20
+ * import { createLogger, runWithLogContext, readLogs } from 'hazo_logs/server';
21
+ * ```
22
+ *
23
+ * ### Client Components (sends logs to server API)
24
+ * For logging that persists to server:
25
+ * ```typescript
26
+ * import { createClientLogger } from 'hazo_logs/ui';
27
+ * ```
28
+ *
29
+ * ### UI Components (log viewer)
30
+ * ```typescript
31
+ * import { LogViewerPage } from 'hazo_logs/ui';
32
+ * import { createLogApiHandler } from 'hazo_logs/ui/server';
33
+ * ```
24
34
  */
25
- // Core logging
26
- export { HazoLogger } from './lib/hazo_logger.js';
27
- export { PackageLogger, createLogger } from './lib/package_logger.js';
28
- export { loadConfig } from './lib/config_loader.js';
29
- // Log context
30
- export { generateSessionId, startSession, startSessionAsync, runWithLogContext, runWithLogContextAsync, getLogContext, withSession, withContext, } from './lib/context/log-context.js';
31
- // Log reader
32
- export { readLogs, getAvailableLogDates, getUniquePackages, getUniqueExecutionIds, getUniqueSessionIds, getUniqueReferences, } from './lib/log-reader.js';
35
+ // Universal logger - works on both server and client
36
+ export { createLogger, createLoggerAsync, preloadServerLogger, ConsoleLogger, } from './lib/universal-logger.js';
33
37
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,eAAe;AACf,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACtE,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAEpD,cAAc;AACd,OAAO,EACL,iBAAiB,EACjB,YAAY,EACZ,iBAAiB,EACjB,iBAAiB,EACjB,sBAAsB,EACtB,aAAa,EACb,WAAW,EACX,WAAW,GACZ,MAAM,8BAA8B,CAAC;AAEtC,aAAa;AACb,OAAO,EACL,QAAQ,EACR,oBAAoB,EACpB,iBAAiB,EACjB,qBAAqB,EACrB,mBAAmB,EACnB,mBAAmB,GACpB,MAAM,qBAAqB,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AAEH,qDAAqD;AACrD,OAAO,EACL,YAAY,EACZ,iBAAiB,EACjB,mBAAmB,EACnB,aAAa,GACd,MAAM,2BAA2B,CAAC"}
@@ -0,0 +1,67 @@
1
+ /**
2
+ * Universal Logger - Works on both server and client
3
+ *
4
+ * On server: Uses the full PackageLogger with file transports
5
+ * On client: Uses console-based logging (logs are not persisted)
6
+ *
7
+ * For full server logging capabilities, import from 'hazo_logs/server'
8
+ * For client logging that posts to server API, use 'hazo_logs/ui' createClientLogger
9
+ */
10
+ import type { Logger, LogData, LogLevel } from './types.js';
11
+ /**
12
+ * Console-based logger for client-side use
13
+ * Provides basic logging that outputs to browser console
14
+ */
15
+ declare class ConsoleLogger implements Logger {
16
+ private packageName;
17
+ private minLevel;
18
+ constructor(packageName: string, minLevel?: LogLevel);
19
+ private shouldLog;
20
+ private formatMessage;
21
+ error(message: string, data?: LogData): void;
22
+ warn(message: string, data?: LogData): void;
23
+ info(message: string, data?: LogData): void;
24
+ debug(message: string, data?: LogData): void;
25
+ }
26
+ /**
27
+ * Pre-load the server logger module (call this early in server startup)
28
+ * This allows createLogger to return a real server logger synchronously
29
+ */
30
+ export declare function preloadServerLogger(): Promise<void>;
31
+ /**
32
+ * Create a universal logger that works on both server and client
33
+ *
34
+ * On server: Returns PackageLogger (may start as ConsoleLogger and upgrade)
35
+ * On client: Returns ConsoleLogger that outputs to browser console
36
+ *
37
+ * @param packageName - Name of the package (e.g., "hazo_auth", "my_app")
38
+ * @returns Logger instance
39
+ *
40
+ * @example
41
+ * ```typescript
42
+ * import { createLogger } from 'hazo_logs';
43
+ *
44
+ * const logger = createLogger('my_app');
45
+ * logger.info('Application started');
46
+ * ```
47
+ *
48
+ * Note: For full server capabilities (context, sessions), use:
49
+ * ```typescript
50
+ * import { createLogger } from 'hazo_logs/server';
51
+ * ```
52
+ *
53
+ * For client logging that persists to server, use:
54
+ * ```typescript
55
+ * import { createClientLogger } from 'hazo_logs/ui';
56
+ * ```
57
+ */
58
+ export declare function createLogger(packageName: string): Logger;
59
+ /**
60
+ * Async version of createLogger - returns real server logger immediately
61
+ *
62
+ * @param packageName - Name of the package
63
+ * @returns Promise<Logger>
64
+ */
65
+ export declare function createLoggerAsync(packageName: string): Promise<Logger>;
66
+ export { ConsoleLogger };
67
+ //# sourceMappingURL=universal-logger.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"universal-logger.d.ts","sourceRoot":"","sources":["../../src/lib/universal-logger.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAgB5D;;;GAGG;AACH,cAAM,aAAc,YAAW,MAAM;IACnC,OAAO,CAAC,WAAW,CAAS;IAC5B,OAAO,CAAC,QAAQ,CAAW;gBAEf,WAAW,EAAE,MAAM,EAAE,QAAQ,GAAE,QAAkB;IAK7D,OAAO,CAAC,SAAS;IAIjB,OAAO,CAAC,aAAa;IAKrB,KAAK,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,OAAO,GAAG,IAAI;IAM5C,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,OAAO,GAAG,IAAI;IAM3C,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,OAAO,GAAG,IAAI;IAM3C,KAAK,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,OAAO,GAAG,IAAI;CAK7C;AAoDD;;;GAGG;AACH,wBAAsB,mBAAmB,IAAI,OAAO,CAAC,IAAI,CAAC,CAYzD;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,wBAAgB,YAAY,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,CAgBxD;AAED;;;;;GAKG;AACH,wBAAsB,iBAAiB,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAqB5E;AAGD,OAAO,EAAE,aAAa,EAAE,CAAC"}
@@ -0,0 +1,191 @@
1
+ /**
2
+ * Universal Logger - Works on both server and client
3
+ *
4
+ * On server: Uses the full PackageLogger with file transports
5
+ * On client: Uses console-based logging (logs are not persisted)
6
+ *
7
+ * For full server logging capabilities, import from 'hazo_logs/server'
8
+ * For client logging that posts to server API, use 'hazo_logs/ui' createClientLogger
9
+ */
10
+ const LOG_LEVEL_PRIORITY = {
11
+ error: 0,
12
+ warn: 1,
13
+ info: 2,
14
+ debug: 3,
15
+ };
16
+ /**
17
+ * Check if we're running on the server
18
+ */
19
+ function isServer() {
20
+ return typeof window === 'undefined';
21
+ }
22
+ /**
23
+ * Console-based logger for client-side use
24
+ * Provides basic logging that outputs to browser console
25
+ */
26
+ class ConsoleLogger {
27
+ packageName;
28
+ minLevel;
29
+ constructor(packageName, minLevel = 'debug') {
30
+ this.packageName = packageName;
31
+ this.minLevel = minLevel;
32
+ }
33
+ shouldLog(level) {
34
+ return LOG_LEVEL_PRIORITY[level] <= LOG_LEVEL_PRIORITY[this.minLevel];
35
+ }
36
+ formatMessage(level, message) {
37
+ const timestamp = new Date().toISOString();
38
+ return `[${timestamp}] [${level.toUpperCase()}] [${this.packageName}] ${message}`;
39
+ }
40
+ error(message, data) {
41
+ if (this.shouldLog('error')) {
42
+ console.error(this.formatMessage('error', message), data ?? '');
43
+ }
44
+ }
45
+ warn(message, data) {
46
+ if (this.shouldLog('warn')) {
47
+ console.warn(this.formatMessage('warn', message), data ?? '');
48
+ }
49
+ }
50
+ info(message, data) {
51
+ if (this.shouldLog('info')) {
52
+ console.info(this.formatMessage('info', message), data ?? '');
53
+ }
54
+ }
55
+ debug(message, data) {
56
+ if (this.shouldLog('debug')) {
57
+ console.debug(this.formatMessage('debug', message), data ?? '');
58
+ }
59
+ }
60
+ }
61
+ /**
62
+ * Deferred logger that upgrades from ConsoleLogger to real server logger
63
+ * when the server module is loaded asynchronously
64
+ */
65
+ class DeferredServerLogger {
66
+ packageName;
67
+ innerLogger;
68
+ upgraded = false;
69
+ constructor(packageName) {
70
+ this.packageName = packageName;
71
+ this.innerLogger = new ConsoleLogger(packageName);
72
+ // Attempt async upgrade to real server logger
73
+ this.upgrade();
74
+ }
75
+ async upgrade() {
76
+ if (this.upgraded)
77
+ return;
78
+ try {
79
+ const { createLogger } = await import('./package_logger.js');
80
+ this.innerLogger = createLogger(this.packageName);
81
+ this.upgraded = true;
82
+ }
83
+ catch {
84
+ // Keep using ConsoleLogger
85
+ }
86
+ }
87
+ error(message, data) {
88
+ this.innerLogger.error(message, data);
89
+ }
90
+ warn(message, data) {
91
+ this.innerLogger.warn(message, data);
92
+ }
93
+ info(message, data) {
94
+ this.innerLogger.info(message, data);
95
+ }
96
+ debug(message, data) {
97
+ this.innerLogger.debug(message, data);
98
+ }
99
+ }
100
+ // Cache for pre-loaded server loggers
101
+ const serverLoggerCache = new Map();
102
+ let serverModuleLoaded = false;
103
+ let serverModulePromise = null;
104
+ /**
105
+ * Pre-load the server logger module (call this early in server startup)
106
+ * This allows createLogger to return a real server logger synchronously
107
+ */
108
+ export async function preloadServerLogger() {
109
+ if (!isServer() || serverModuleLoaded)
110
+ return;
111
+ try {
112
+ if (!serverModulePromise) {
113
+ serverModulePromise = import('./package_logger.js');
114
+ }
115
+ await serverModulePromise;
116
+ serverModuleLoaded = true;
117
+ }
118
+ catch {
119
+ // Silently fail
120
+ }
121
+ }
122
+ /**
123
+ * Create a universal logger that works on both server and client
124
+ *
125
+ * On server: Returns PackageLogger (may start as ConsoleLogger and upgrade)
126
+ * On client: Returns ConsoleLogger that outputs to browser console
127
+ *
128
+ * @param packageName - Name of the package (e.g., "hazo_auth", "my_app")
129
+ * @returns Logger instance
130
+ *
131
+ * @example
132
+ * ```typescript
133
+ * import { createLogger } from 'hazo_logs';
134
+ *
135
+ * const logger = createLogger('my_app');
136
+ * logger.info('Application started');
137
+ * ```
138
+ *
139
+ * Note: For full server capabilities (context, sessions), use:
140
+ * ```typescript
141
+ * import { createLogger } from 'hazo_logs/server';
142
+ * ```
143
+ *
144
+ * For client logging that persists to server, use:
145
+ * ```typescript
146
+ * import { createClientLogger } from 'hazo_logs/ui';
147
+ * ```
148
+ */
149
+ export function createLogger(packageName) {
150
+ if (!isServer()) {
151
+ // Client-side: return console logger
152
+ return new ConsoleLogger(packageName);
153
+ }
154
+ // Check cache first
155
+ const cached = serverLoggerCache.get(packageName);
156
+ if (cached) {
157
+ return cached;
158
+ }
159
+ // Server-side: create deferred logger that upgrades asynchronously
160
+ const logger = new DeferredServerLogger(packageName);
161
+ serverLoggerCache.set(packageName, logger);
162
+ return logger;
163
+ }
164
+ /**
165
+ * Async version of createLogger - returns real server logger immediately
166
+ *
167
+ * @param packageName - Name of the package
168
+ * @returns Promise<Logger>
169
+ */
170
+ export async function createLoggerAsync(packageName) {
171
+ if (!isServer()) {
172
+ return new ConsoleLogger(packageName);
173
+ }
174
+ try {
175
+ if (!serverModulePromise) {
176
+ serverModulePromise = import('./package_logger.js');
177
+ }
178
+ const { createLogger } = await serverModulePromise;
179
+ serverModuleLoaded = true;
180
+ const logger = createLogger(packageName);
181
+ serverLoggerCache.set(packageName, logger);
182
+ return logger;
183
+ }
184
+ catch {
185
+ console.warn(`[hazo_logs] Failed to load server logger, falling back to console logger for ${packageName}`);
186
+ return new ConsoleLogger(packageName);
187
+ }
188
+ }
189
+ // Export ConsoleLogger for direct use if needed
190
+ export { ConsoleLogger };
191
+ //# sourceMappingURL=universal-logger.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"universal-logger.js","sourceRoot":"","sources":["../../src/lib/universal-logger.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAIH,MAAM,kBAAkB,GAA6B;IACnD,KAAK,EAAE,CAAC;IACR,IAAI,EAAE,CAAC;IACP,IAAI,EAAE,CAAC;IACP,KAAK,EAAE,CAAC;CACT,CAAC;AAEF;;GAEG;AACH,SAAS,QAAQ;IACf,OAAO,OAAO,MAAM,KAAK,WAAW,CAAC;AACvC,CAAC;AAED;;;GAGG;AACH,MAAM,aAAa;IACT,WAAW,CAAS;IACpB,QAAQ,CAAW;IAE3B,YAAY,WAAmB,EAAE,WAAqB,OAAO;QAC3D,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;QAC/B,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAC3B,CAAC;IAEO,SAAS,CAAC,KAAe;QAC/B,OAAO,kBAAkB,CAAC,KAAK,CAAC,IAAI,kBAAkB,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IACxE,CAAC;IAEO,aAAa,CAAC,KAAe,EAAE,OAAe;QACpD,MAAM,SAAS,GAAG,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;QAC3C,OAAO,IAAI,SAAS,MAAM,KAAK,CAAC,WAAW,EAAE,MAAM,IAAI,CAAC,WAAW,KAAK,OAAO,EAAE,CAAC;IACpF,CAAC;IAED,KAAK,CAAC,OAAe,EAAE,IAAc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AC,CAAC;IACxC,CAAC;AACH,CAAC;AAED,gDAAgD;AAChD,OAAO,EAAE,aAAa,EAAE,CAAC"}
@@ -0,0 +1,24 @@
1
+ /**
2
+ * hazo_logs/server - Server-only logging module
3
+ *
4
+ * ⚠️ SERVER-ONLY: This module uses Node.js APIs (fs, async_hooks) and CANNOT be
5
+ * imported in client components. Import will fail in browser bundles.
6
+ *
7
+ * Usage:
8
+ * import { createLogger, runWithLogContext } from 'hazo_logs/server';
9
+ *
10
+ * const logger = createLogger('my_package');
11
+ * logger.info('Hello world', { key: 'value' });
12
+ *
13
+ * For client-side logging, use:
14
+ * import { createClientLogger } from 'hazo_logs/ui';
15
+ */
16
+ import 'server-only';
17
+ export { HazoLogger } from './lib/hazo_logger.js';
18
+ export { PackageLogger, createLogger } from './lib/package_logger.js';
19
+ export { loadConfig } from './lib/config_loader.js';
20
+ export { generateSessionId, startSession, startSessionAsync, runWithLogContext, runWithLogContextAsync, getLogContext, withSession, withContext, } from './lib/context/log-context.js';
21
+ export { readLogs, getAvailableLogDates, getUniquePackages, getUniqueExecutionIds, getUniqueSessionIds, getUniqueReferences, } from './lib/log-reader.js';
22
+ export type { Logger, LogLevel, LogData, LogEntry, LogContext, HazoLogConfig, PackageLoggerOptions, } from './lib/types.js';
23
+ export type { ReadLogsOptions, LogQueryResult } from './lib/log-reader.js';
24
+ //# sourceMappingURL=server.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,aAAa,CAAC;AAGrB,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACtE,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAGpD,OAAO,EACL,iBAAiB,EACjB,YAAY,EACZ,iBAAiB,EACjB,iBAAiB,EACjB,sBAAsB,EACtB,aAAa,EACb,WAAW,EACX,WAAW,GACZ,MAAM,8BAA8B,CAAC;AAGtC,OAAO,EACL,QAAQ,EACR,oBAAoB,EACpB,iBAAiB,EACjB,qBAAqB,EACrB,mBAAmB,EACnB,mBAAmB,GACpB,MAAM,qBAAqB,CAAC;AAG7B,YAAY,EACV,MAAM,EACN,QAAQ,EACR,OAAO,EACP,QAAQ,EACR,UAAU,EACV,aAAa,EACb,oBAAoB,GACrB,MAAM,gBAAgB,CAAC;AAExB,YAAY,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC"}
package/dist/server.js ADDED
@@ -0,0 +1,25 @@
1
+ /**
2
+ * hazo_logs/server - Server-only logging module
3
+ *
4
+ * ⚠️ SERVER-ONLY: This module uses Node.js APIs (fs, async_hooks) and CANNOT be
5
+ * imported in client components. Import will fail in browser bundles.
6
+ *
7
+ * Usage:
8
+ * import { createLogger, runWithLogContext } from 'hazo_logs/server';
9
+ *
10
+ * const logger = createLogger('my_package');
11
+ * logger.info('Hello world', { key: 'value' });
12
+ *
13
+ * For client-side logging, use:
14
+ * import { createClientLogger } from 'hazo_logs/ui';
15
+ */
16
+ import 'server-only';
17
+ // Core logging
18
+ export { HazoLogger } from './lib/hazo_logger.js';
19
+ export { PackageLogger, createLogger } from './lib/package_logger.js';
20
+ export { loadConfig } from './lib/config_loader.js';
21
+ // Log context (uses AsyncLocalStorage)
22
+ export { generateSessionId, startSession, startSessionAsync, runWithLogContext, runWithLogContextAsync, getLogContext, withSession, withContext, } from './lib/context/log-context.js';
23
+ // Log reader (uses fs, readline)
24
+ export { readLogs, getAvailableLogDates, getUniquePackages, getUniqueExecutionIds, getUniqueSessionIds, getUniqueReferences, } from './lib/log-reader.js';
25
+ //# sourceMappingURL=server.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"server.js","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,aAAa,CAAC;AAErB,eAAe;AACf,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACtE,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAEpD,uCAAuC;AACvC,OAAO,EACL,iBAAiB,EACjB,YAAY,EACZ,iBAAiB,EACjB,iBAAiB,EACjB,sBAAsB,EACtB,aAAa,EACb,WAAW,EACX,WAAW,GACZ,MAAM,8BAA8B,CAAC;AAEtC,iCAAiC;AACjC,OAAO,EACL,QAAQ,EACR,oBAAoB,EACpB,iBAAiB,EACjB,qBAAqB,EACrB,mBAAmB,EACnB,mBAAmB,GACpB,MAAM,qBAAqB,CAAC"}
@@ -1,8 +1,12 @@
1
1
  /**
2
2
  * Server-side UI exports for hazo_logs
3
3
  *
4
+ * ⚠️ SERVER-ONLY: This module uses Node.js APIs and CANNOT be
5
+ * imported in client components.
6
+ *
4
7
  * Use these in API routes and server components only.
5
8
  */
9
+ import 'server-only';
6
10
  export { createLogApiHandler } from './api/log-api-handler.js';
7
11
  export { withLogAuth } from './middleware/with-log-auth.js';
8
12
  export type { LogApiConfig, LogApiHandler, AuthCheckFn, } from './types.js';
@@ -1 +1 @@
1
- {"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../src/ui/server.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAG/D,OAAO,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AAG5D,YAAY,EACV,YAAY,EACZ,aAAa,EACb,WAAW,GACZ,MAAM,YAAY,CAAC"}
1
+ {"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../src/ui/server.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,aAAa,CAAC;AAGrB,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAG/D,OAAO,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AAG5D,YAAY,EACV,YAAY,EACZ,aAAa,EACb,WAAW,GACZ,MAAM,YAAY,CAAC"}
package/dist/ui/server.js CHANGED
@@ -1,8 +1,12 @@
1
1
  /**
2
2
  * Server-side UI exports for hazo_logs
3
3
  *
4
+ * ⚠️ SERVER-ONLY: This module uses Node.js APIs and CANNOT be
5
+ * imported in client components.
6
+ *
4
7
  * Use these in API routes and server components only.
5
8
  */
9
+ import 'server-only';
6
10
  // API Handler
7
11
  export { createLogApiHandler } from './api/log-api-handler.js';
8
12
  // Middleware
@@ -1 +1 @@
1
- {"version":3,"file":"server.js","sourceRoot":"","sources":["../../src/ui/server.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,cAAc;AACd,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAE/D,aAAa;AACb,OAAO,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC"}
1
+ {"version":3,"file":"server.js","sourceRoot":"","sources":["../../src/ui/server.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,aAAa,CAAC;AAErB,cAAc;AACd,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAE/D,aAAa;AACb,OAAO,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hazo_logs",
3
- "version": "1.0.6",
3
+ "version": "1.0.8",
4
4
  "description": "Logger for hazo packages - Winston wrapper with singleton pattern",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -11,6 +11,11 @@
11
11
  "import": "./dist/index.js",
12
12
  "require": "./dist/index.js"
13
13
  },
14
+ "./server": {
15
+ "types": "./dist/server.d.ts",
16
+ "import": "./dist/server.js",
17
+ "require": "./dist/server.js"
18
+ },
14
19
  "./ui": {
15
20
  "types": "./dist/ui/index.d.ts",
16
21
  "import": "./dist/ui/index.js",
@@ -57,6 +62,7 @@
57
62
  "homepage": "https://github.com/pub12/hazo_logs#readme",
58
63
  "dependencies": {
59
64
  "ini": "^4.1.0",
65
+ "server-only": "^0.0.1",
60
66
  "winston": "^3.17.0",
61
67
  "winston-daily-rotate-file": "^5.0.0"
62
68
  },