/** * `@loghq/stacks` - stream a Stacks application's logs into loghq. * * The short version, in a Stacks app: * * import { install } from '@loghq/stacks' * install({ key: 'loghq_...' }) * * That attaches to the framework's `log` singleton, so every existing * `log.info` / `log.error` / `log.struct` call site starts shipping without * being touched. See `./stacks` for how the attachment is chosen. * * Outside a Stacks app the same client works standalone through `init()` and * the capture helpers, since `@stacksjs/*` is only ever an optional runtime * probe and never a dependency. */ import type { LogHQConfig, LogHQLevel, LogHQUser } from './types'; import { LogHQClient } from './client'; import { install } from './stacks'; export * from './types'; export * from './levels'; export * from './client'; export * from './stacks'; /** Create a client without touching the Stacks logger. Use `install()` in a Stacks app. */ export declare function init(config: LogHQConfig): LogHQClient; export declare function getClient(): LogHQClient | null; export declare function capture(level: LogHQLevel, message: string, context?: Record): void; export declare function captureException(err: unknown, extra?: Record): void; export declare function setUser(user: LogHQUser | null): void; /** Resolves `true` when the queue drained, `false` when something was lost. */ export declare function flush(): Promise; /** Detach from the logger, then drain and shut the client down. */ export declare function close(): Promise; /** The object the docs advertise: `loghq.install({ key })`. */ export declare const loghq: { install: typeof install; init: typeof init; capture: typeof capture; captureException: typeof captureException; flush: typeof flush; close: typeof close; getClient: typeof getClient; }; export default loghq;