Repository: SuperDuperDB/superduperdb
File: superduper/base/config.py (Python)

Code before:
@dc.dataclass
class Downloads(BaseConfig):
    """Describes the configuration for downloading files.

    :param folder: The folder to download files to
    :param n_workers: The number of workers to use for downloading
    :param headers: The headers to use for downloading
    :param timeout: The timeout for downloading
    """

    folder: t.Optional[str] = None
    n_workers: int = 0
    headers: t.Dict = dc.field(default_factory=lambda: {'User-Agent': 'me'})
    timeout: t.Optional[int] = None


@dc.dataclass
class Config(BaseConfig):
    """The data class containing all configurable superduper values.

    :param envs: The envs datas
    :param data_backend: The URI for the data backend
    :param lance_home: The home directory for the Lance vector indices,
                       Default: .superduper/vector_indices
    :param artifact_store: The URI for the artifact store
    :param metadata_store: The URI for the metadata store
    :param cluster: Settings distributed computing and change data capture
    :param retries: Settings for retrying failed operations
    :param downloads: Settings for downloading files
    :param fold_probability: The probability of validation fold
    :param log_level: The severity level of the logs
    :param logging_type: The type of logging to use
    :param bytes_encoding: The encoding of bytes in the data backend
    :param auto_schema: Whether to automatically create the schema.
                        If True, the schema will be created if it does not exist.
    """

    envs: dc.InitVar[t.Optional[t.Dict[str, str]]] = None

    data_backend: str = 'mongodb://mongodb:27017/test_db'
    lance_home: str = os.path.join('.superduper', 'vector_indices')

    artifact_store: t.Optional[str] = None
    metadata_store: t.Optional[str] = None

    cluster: Cluster = dc.field(default_factory=Cluster)
    retries: Retry = dc.field(default_factory=Retry)
    downloads: Downloads = dc.field(default_factory=Downloads)

    fold_probability: float = 0.05


Review comment (suggestion):
I wouldn't do it like this. 
I would add a variable to the config `colorize` and then in the logging module do one or the other.

Code after:
@dc.dataclass
class Downloads(BaseConfig):
    """Describes the configuration for downloading files.

    :param folder: The folder to download files to
    :param n_workers: The number of workers to use for downloading
    :param headers: The headers to use for downloading
    :param timeout: The timeout for downloading
    """

    folder: t.Optional[str] = None
    n_workers: int = 0
    headers: t.Dict = dc.field(default_factory=lambda: {'User-Agent': 'me'})
    timeout: t.Optional[int] = None


@dc.dataclass
class Config(BaseConfig):
    """The data class containing all configurable superduper values.

    :param envs: The envs datas
    :param data_backend: The URI for the data backend
    :param lance_home: The home directory for the Lance vector indices,
                       Default: .superduper/vector_indices
    :param artifact_store: The URI for the artifact store
    :param metadata_store: The URI for the metadata store
    :param cluster: Settings distributed computing and change data capture
    :param retries: Settings for retrying failed operations
    :param downloads: Settings for downloading files
    :param fold_probability: The probability of validation fold
    :param log_level: The severity level of the logs
    :param logging_type: The type of logging to use
    :param bytes_encoding: The encoding of bytes in the data backend
    :param auto_schema: Whether to automatically create the schema.
                        If True, the schema will be created if it does not exist.
    :param log_colorize: Whether to colorize the logs
    """

    envs: dc.InitVar[t.Optional[t.Dict[str, str]]] = None

    data_backend: str = 'mongodb://mongodb:27017/test_db'
    lance_home: str = os.path.join('.superduper', 'vector_indices')

    artifact_store: t.Optional[str] = None
    metadata_store: t.Optional[str] = None

    cluster: Cluster = dc.field(default_factory=Cluster)
    retries: Retry = dc.field(default_factory=Retry)
    downloads: Downloads = dc.field(default_factory=Downloads)

    fold_probability: float = 0.05