import { type SizedSet } from './logBuffer.js'; /** * Manages per-invocation log state with automatic context detection. * * This class abstracts the storage mechanism for state that must be scoped to * a single invocation, automatically choosing between the InvokeStore (when * invocations run concurrently in the same execution environment) and an * instance-level fallback shared across sequential invocations. The decision * is made at runtime on every access to support Lambda's transition to async * contexts. * * It holds: * - the effective log level, so per-invocation changes like the debug sampling * decision don't leak across concurrent invocations, with the base level as * the fallback; * - the log buffer, grouped by `_X_AMZN_TRACE_ID` with each group capped at * `maxBytes` (only after {@link LogInvocationStore.configureBuffer | `configureBuffer()`}). */ declare class LogInvocationStore { #private; constructor(logLevel: number); /** * Get the log level in effect: the per-invocation level when one has been * set, otherwise the base level. */ getLogLevel(): number; /** * Get the base log level shared across invocations, without consulting the * InvokeStore. */ getBaseLogLevel(): number; /** * Set the log level, scoping it to the current invocation when concurrency * is enabled and an invocation context is active. Outside an invocation * context (e.g. during initialization) the base level is set instead. */ setLogLevel(logLevel: number): void; /** * Set the base log level shared across invocations, regardless of any active * invocation context. Used at initialization and for Advanced Logging * Controls, which apply environment-wide. */ setBaseLogLevel(logLevel: number): void; /** * Enable the log buffer with the given max byte size per trace id. * * Must be called before any buffer operation; the buffer methods are only * reached when buffering is enabled. * * @param maxBytes - Max byte size of each trace id's buffer */ configureBuffer(maxBytes: number): void; /** * Add a log to the buffer for the given trace id. * * @param traceId - `_X_AMZN_TRACE_ID` of the request * @param value - The serialized log to be buffered * @param logLevel - The level of the log to be buffered */ add(traceId: string, value: string, logLevel: number): void; /** * Get the buffered logs for the given trace id, if any. * * @param traceId - `_X_AMZN_TRACE_ID` of the request */ get(traceId: string): SizedSet | undefined; /** * Empty the buffer for the given trace id. * * @param traceId - `_X_AMZN_TRACE_ID` of the request */ delete(traceId: string): void; } export { LogInvocationStore }; //# sourceMappingURL=LogInvocationStore.d.ts.map