Usage
Send events, levels, optional fields, and client options with oleq_logs
Send events
await log.info(LogPayload(message: 'screen opened'));
await log.warn(LogPayload(message: 'slow query', body: {'ms': 420}));
await log.error(LogPayload(
message: 'checkout failed',
kind: LogKind.res,
body: {'status': 402},
));
await log.flush();
await log.close();Call flush() before app backgrounding or isolate shutdown when possible.
Levels
Pass as type on the event, or call the matching method (log.info(…), log.error(…), …).
tracedebuginfosuccesswarnerrorfatalauditmetric
Optional fields
| Field | Notes |
|---|---|
kind | LogKind.req or LogKind.res — separate events; dashboard shows REQ / RES badges |
body | Any JSON-serializable attachment |
track / security / metrics | Structured maps on the event |
Options
| Option | Required | Default |
|---|---|---|
appName | yes | — |
apiKey | no* | OLEQLOG_API_KEY / --dart-define |
baseUrl | no | production API |
environment | no | development |
flushIntervalMs | no | 2000 |
maxBatchSize | no | 50 |
sensitive | no | optional field redact / strip before send |
*Required unless OLEQLOG_API_KEY is set.
Stack recipes: Examples