Skip to content
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

chore: revert ReadConfig function #54

Merged
merged 1 commit into from
Jan 19, 2025
Merged

chore: revert ReadConfig function #54

merged 1 commit into from
Jan 19, 2025

Conversation

jmeridth
Copy link
Member

@jmeridth jmeridth commented Jan 19, 2025

  • replaced fmt logging with message, key/value pair logging format
  • revert ReadConfig function as it causes the log to not be read initially
  • fixed trace output of config (write directory and invasive were reversed)

I tested this inside the generated plugin and also from the core level. Having the CORRECT config is the fix. Not a code change.

Example new output of config trace:

config.yml

logLevel: trace
write-directory: test_output
services:
  my-cloud-services1:
    plugin: example
    test-suites:
      # - tlp_red
      # - tlp_amber
      - tlp_green
      - tlp_clear

Service name NOT provided

➜  privateer git:(main) ✗ ./privateer run
2025-01-19T03:56:45.775-0600 [TRACE] Creating a new config instance for service: serviceName=overview loglevel=trace write-directory=/Users/jmeridth/.privateer/logs/2025-01-19T035645-0600 invasive=false test-suites=[] vars=map[] writing output to file=true

Service name provided

➜  privateer git:(main) ✗ ./privateer run --service my-cloud-services1
2025-01-19T04:01:44.149-0600 [TRACE] Creating a new config instance for service: serviceName=my-cloud-services1 loglevel=trace write-directory=/Users/jmeridth/.privateer/logs/2025-01-19T040144-0600 invasive=false test-suites=["tlp_green", "tlp_clear"] vars=map[] writing output to file=true

Want to get this merged before I finish my work on #50

- [x] replaced fmt logging with message, key/value pair logging format
- [x] revert ReadConfig function as it causes the log to not be read initially
- [x] fixed trace output of config (write directory and invasive were reversed)

Signed-off-by: jmeridth <[email protected]>
@jmeridth jmeridth self-assigned this Jan 19, 2025
@jmeridth jmeridth requested a review from a team as a code owner January 19, 2025 15:32
@jmeridth
Copy link
Member Author

@eddie-knight I don't know if you feel strongly about logs being newlined or not. Willing to remove that change if necessary.

I realized my issues were I still had writeDirectory in my config.yml. It needed to be write-directory.

@jmeridth
Copy link
Member Author

Once this release happens, I'll do a quick follow-up PR in core and remove the ReadConfig call there.

Copy link
Contributor

@eddie-knight eddie-knight left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ran locally to confirm expected behavior with privateer and with "debug" on a plugin— everything works as expected. Thanks for this @jmeridth

@jmeridth jmeridth merged commit d6c6598 into main Jan 19, 2025
8 checks passed
@jmeridth jmeridth deleted the jm_fix_trace_output branch January 19, 2025 15:47
jmeridth added a commit to privateerproj/privateer that referenced this pull request Jan 19, 2025
jmeridth added a commit to privateerproj/privateer that referenced this pull request Jan 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants