Skip to content

Support diesel_logger outside of unit tests #903

Open
@pjenvey

Description

@pjenvey

Logging diesel's queries via diesel_logger can be useful outside of unit tests. Currently diesel_logger's LoggingConnection is hardcoded to #[cfg(test)].

We could instead make this a setting to enable it (e.g. SYNC_DATABASE_DIESEL_LOGGER=true) or just always enable it if it doesn't cost much in overhead.

This feature could also use a couple more things:

  1. consider changing the log crate's max value in debug builds to max_level_debug (in Cargo.toml). Though this change might add a lot of extra log spew during development (this needs some investigation)?
  2. docs on how to use it (maybe unnecessary or very little needed if Initial Rust project with file structure layout #1 is fixed)

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions