> ## Documentation Index
> Fetch the complete documentation index at: https://wb-21fd5541-docs-1917.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# How do I enable code logging with Sweeps?

To enable code logging for sweeps, add `wandb.log_code()` after initializing the W\&B Run. This action is necessary even when code logging is enabled in the W\&B profile settings. For advanced code logging, refer to the [docs for `wandb.log_code()` here](/models/ref/python/experiments/run#log_code).

***

<Badge stroke shape="pill" color="orange" size="md">[Sweeps](/support/models/tags/sweeps)</Badge>
