Skip to content
LogoLogo

setDebug

Turns the sensitive debug channel on or off for the whole process: the raw data nautilus redacts everywhere else, for diagnosing a failure the redacted error does not explain. See the debugging guide for what each tier prints and how to share its output safely.

Usage

import {  } from '@deltadao/nautilus'
 
.({ : 'sensitive' }) 

Without a code change, in Node: NAUTILUS_DEBUG=sensitive node app.js. See environment variables.

Returns

void

Parameters

options

  • Type: DebugOptions

Replaces the whole setting (options left out go back to their defaults) and overrides the environment variables. An unknown level or topic throws a TypeError.

level

  • Type: 'off' | 'sensitive' | 'secrets'
LevelAdds to the debug channel
off (default)Nothing.
sensitiveRaw node, wallet, verifier and RPC answers; policy-server session ids and verifier redirect URIs; the verifier's per-policy results with their full errors; request payloads (download URLs with signature, nonce and the session id); raw signed transactions; presented VP/VC JWTs; storage pointers without their credentials.
secretsEverything in sensitive, plus long-lived credentials: the RPC URL with its token, S3 secret keys, IPFS (Pinata) JWTs, Authorization headers.

sensitive hides long-lived credentials best effort, by name and shape (see the debugging guide): scan its output before sharing it.

The signer's private key or mnemonic is never printed, at any tier: nautilus never holds them, the signer does.

topics

  • Type: DebugTopic[], of 'node' | 'wallet' | 'policy' | 'rpc' | 'order' | 'nonce' | 'store' | 'compute'
  • Default: all

Only events about these topics print. Every topic also carries the raw fields of nautilus's own log events of its component, but only of events printed at the current log level: pair the channel with NAUTILUS_LOG_LEVEL=debug (or configureLogging({ level: 'debug' })) to see them all. The raw error of an operation's …operation.failed (or …query.failed) event goes to the topic of where the error came from when nautilus knows it: a PolicyDeniedError or CredentialPresentationError to policy, a WaltIdWalletError to wallet, a NonceGuardError or IndexerNonceStuckError to nonce, also as the cause of another error. Any other error goes to the operation's topic (access.operation.failed to order, publish.operation.failed to rpc).

TopicEvents
nodeocean-node answers and errors, and the raw arguments of ocean.js's captured lines (oceanjs.logger.*, e.g. the request payload of a refused compute start).
walletThe walt.id wallet: its error answers, the resolved presentation request, the presentation result.
policyPolicy-server sessions (the initiate reply), the verifier's session record and per-policy results, and a checkSessionId answer that is not the policy server's envelope (a proxy's 502 page), as it came.
rpcThe chain RPC: errors with their request URL and response.
orderThe raw fields of the access log events, and the errors of the previous-order lookup and of the price read before redaction. Events of their own for orders: not emitted yet (from PRs 7 and 10d).
nonceThe raw fields of the publish preflight's nonce warnings; nonce reads, the nonce guard's decisions (nonce chosen, refusal, resync, proof) and the signed transactions of refused sends.
storeRemote stores: storage pointers, store answers.
computeThe raw fields of the compute log events. Events of their own for compute jobs: not emitted yet (from PR 10d).

sink

  • Type: (event: DebugEvent) => void

Receives each event instead of stderr, e.g. to write a local file. A sink that throws is ignored.

.({
  : 'sensitive',
  : ['policy', 'wallet'],
  : () =>
    ('nautilus-debug.jsonl', `${.()}\n`, { : 0o600 }) 
})

Each event is a DebugEvent:

PropertyType
timestringISO 8601 timestamp.
tier'sensitive' | 'secrets'secrets when the data holds a long-lived credential (only with level: 'secrets').
topicDebugTopic
messagestringWhat the data is, e.g. answer HTTP 400 Bad Request.
opId, operationstringThe operation the event belongs to, as on the log events. In Node 22.3 or newer only; unset outside an operation.
dataunknownThe raw value as plain data. An error becomes { name, message, …, cause }. After masking, strings are cut at 32,768 characters and the event at about 256 KB. A string longer than 65,536 characters, or past the event's size, is read only up to the last word before that point, so no credential is shown in part. Each cut ends in …(cut: N of M characters shown), M being the length as given.

Output

Without a sink, each event is one line on stderr (console.info in a browser), prefixed with its tier and topic, and within an operation its name and opId after the time (… 2026-10-10T13:36:58.772Z [access 3f9a2c1b07e4] verifier per-policy results …). Line breaks and control characters in the data are written as JSON escapes, so an event never spans two lines:

[nautilus:debug:sensitive] [policy] 2026-10-10T13:36:58.772Z [access 3f9a2c1b07e4] verifier per-policy results (checkSessionId) {"sessionId":"…","verificationResult":false,"policies":["VerifiablePresentation holder-binding: failed (java.lang.NullPointerException)", …]}
[nautilus:debug:SECRETS] [rpc] 2026-10-10T13:37:02.104Z [publish 8c41d07e5a19] log event publish.metadata.events_unchecked before redaction {…}

What does not change

Errors, return values (e.g. PublishResponse.stored), PolicyDeniedError and log events stay exactly as redacted as with the channel off. Apps log, store and return those, so nautilus never un-redacts them; the raw values go to this channel only.

Nothing in what nautilus sends changes either. After a presentation the verifier refused, nautilus reads the verifier's record (checkSessionId) with the channel on or off, to name the failed policies in the PolicyDeniedError; with the policy topic on, the whole record also reaches the channel.

Warning on enabling

Turning a tier on prints a warning on stderr that no log level or sink suppresses, once per tier per process. Under NODE_ENV=production it is stronger and says how to turn it off.

Environment variables

Read once, when nautilus is imported. setDebug overrides them. In a browser there is no environment; use setDebug.

VariableValues
NAUTILUS_DEBUGoff, sensitive, secrets
NAUTILUS_DEBUG_TOPICSa comma-separated list, e.g. policy,wallet

Case does not matter. Only the tier names count: NAUTILUS_DEBUG=1 or true turns nothing on, so secrets is reached only by naming it, and NAUTILUS_DEBUG_TOPICS alone turns nothing on. An unknown value is ignored, and a config.env.invalid warning says so. An unknown topic is dropped from the list; a list with no known topic turns on no topic, never all of them.

NAUTILUS_DEBUG=sensitive NAUTILUS_DEBUG_TOPICS=policy,wallet node download.js 2> debug.log