Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

don't trace self or command builders #68

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 21, 2024

Conversation

Dridus
Copy link

@Dridus Dridus commented May 21, 2024

this is a bit more personal opinion so feel free to reject on the grounds that it's not how you like it, but I preferred the traces to be more compact at the expense of gory detail, and not include passwords.

example output before with tracing-subscriber at debug but otherwise default:

2024-05-21T01:30:55.397748Z DEBUG setup{self=PostgreSQL { version: Version { major: 16, minor: Some(3), release: Some(0) }, settings: Settings { installation_dir: "<snip>\\.theseus\\postgresql\\16.3.0", password_file: "<snip>\\AppData\\Local\\Temp\\.tmpUnpHTi\\.pgpass", data_dir: "<snip>", host: "localhost", port: 0, username: "<snip>", password: "<snip>", temporary: false, timeout: Some(5s) } }}:initialize{self=PostgreSQL { version: Version { major: 16, minor: Some(3), release: Some(0) }, settings: Settings { installation_dir: "<snip>\\.theseus\\postgresql\\16.3.0", password_file: "<snip>\\AppData\\Local\\Temp\\.tmpUnpHTi\\.pgpass", data_dir: "<snip>", host: "localhost", port: 0, username: "<snip>", password: "<snip>", temporary: false, timeout: Some(5s) } }}:execute_command{self=PostgreSQL { version: Version { major: 16, minor: Some(3), release: Some(0) }, settings: Settings { installation_dir: "<snip>\\.theseus\\postgresql\\16.3.0", password_file: "<snip>\\AppData\\Local\\Temp\\.tmpUnpHTi\\.pgpass", data_dir: "<snip>", host: "localhost", port: 0, username: "<snip>", password: "<snip>", temporary: false, timeout: Some(5s) } } command_builder=InitDbBuilder { program_dir: Some("<snip>\\.theseus\\postgresql\\16.3.0\\bin"), auth: Some("password"), auth_host: None, auth_local: None, pgdata: Some("<snip>"), encoding: Some("UTF8"), allow_group_access: false, icu_locale: None, icu_rules: None, data_checksums: false, locale: None, lc_collate: None, lc_ctype: None, lc_messages: None, lc_monetary: None, lc_numeric: None, lc_time: None, no_locale: false, locale_provider: None, pwfile: Some("<snip>\\AppData\\Local\\Temp\\.tmpUnpHTi\\.pgpass"), text_search_config: None, username: Some("<snip>"), pwprompt: false, waldir: None, wal_segsize: None, set: None, debug: false, discard_caches: false, directory: None, no_clean: false, no_sync: false, no_instructions: false, show: false, sync_only: false, version: false, help: false }}: postgresql_commands::traits: Executing command: "<snip>\\.theseus\\postgresql\\16.3.0\\bin\\initdb" "--auth" "password" "--pgdata" "<snip>" "--encoding" "UTF8" "--pwfile" "<snip>\\AppData\\Local\\Temp\\.tmpUnpHTi\\.pgpass" "--username" "<snip>"

and after:

2024-05-21T01:31:16.664100Z DEBUG setup:initialize:execute_command{program="initdb"}: postgresql_commands::traits: Executing command: "C:\\Users\\rmm-m\\.theseus\\postgresql\\16.3.0\\bin\\initdb" "--auth" "password" "--pgdata" "<snip>" "--encoding" "UTF8" "--pwfile" "<snip>\\AppData\\Local\\Temp\\.tmpegLodC\\.pgpass" "--username" "<snip>"

this also adds the database name as an explicit field to the various database related functions, e.g.:

2024-05-21T01:31:20.642161Z DEBUG database_exists{database_name="<snip>"}:execute_command{program="psql"}: postgresql_commands::traits: Executing command: "<snip>\\.theseus\\postgresql\\16.3.0\\bin\\psql" "--command" "SELECT 1 FROM pg_database WHERE datname=\'<snip>\'" "--no-psqlrc" "--tuples-only" "--host" "localhost" "--port" "60078" "--username" "<snip>"

@brianheineman
Copy link
Contributor

Hello @Dridus thank you for the PR! Your changes for the traces look good to me and I am happy to include them. However, it looks like this PR contains changes from #67 as well. If you could remove those changes from this PR it would make it easier to review these changes in isolation. Thanks!

…e base name. makes the traces less enormous and also avoids dumping passwords into traces.
@Dridus Dridus force-pushed the rmm/dont-trace-self branch from 2ba7a12 to 33ff7e6 Compare May 21, 2024 15:43
@Dridus
Copy link
Author

Dridus commented May 21, 2024

so revised, back 'atcha

@brianheineman brianheineman merged commit 2783485 into theseus-rs:main May 21, 2024
8 of 10 checks passed
@brianheineman
Copy link
Contributor

This change was released in version 0.9.3; thank you for your contribution!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
Morty Proxy This is a proxified and sanitized view of the page, visit original site.