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

feat(lib): configurable log file location #2380

Merged
merged 3 commits into from Mar 18, 2024

Conversation

Noxsios
Copy link
Contributor

@Noxsios Noxsios commented Mar 14, 2024

Description

Allows for Zarf's logs to still be sent to a log file, but be muted otherwise.

logFile, err := message.UseLogFile("")
if err != nil {
	return err // handle the error as you see fit
}

location := message.LogFileLocation() // get the log file location if you want to

// set pterm output to only go to this logfile
pterm.SetDefaultOutput(logFile)

// disable progress bars (otherwise they will still get printed to STDERR)
message.NoProgress = true

Related Issue

Fixes #2372

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Other (security config, docs update, etc)

Checklist before merging

@Noxsios Noxsios linked an issue Mar 14, 2024 that may be closed by this pull request
Copy link

netlify bot commented Mar 14, 2024

Deploy Preview for zarf-docs ready!

Name Link
🔨 Latest commit 53f9bde
🔍 Latest deploy log https://app.netlify.com/sites/zarf-docs/deploys/65f895686aaddc0007a751cf
😎 Deploy Preview https://deploy-preview-2380--zarf-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@Noxsios Noxsios force-pushed the 2372-lib-configure-pterm-output-during-deploy-lifecycle branch from 8de55bd to 810902d Compare March 14, 2024 03:54
@Noxsios Noxsios changed the title fix: configurable log writer fix: some cleanup in message Mar 14, 2024
Signed-off-by: razzle <harry@razzle.cloud>
@Noxsios Noxsios force-pushed the 2372-lib-configure-pterm-output-during-deploy-lifecycle branch from 0f313fa to 083cc6f Compare March 14, 2024 21:18
Signed-off-by: razzle <harry@razzle.cloud>
@Noxsios Noxsios changed the title fix: some cleanup in message feat(lib): configurable log file Mar 18, 2024
@Noxsios Noxsios self-assigned this Mar 18, 2024
@Noxsios Noxsios added the uds label Mar 18, 2024
@Noxsios Noxsios changed the title feat(lib): configurable log file feat(lib): configurable log file location Mar 18, 2024
@Noxsios Noxsios marked this pull request as ready for review March 18, 2024 19:37
Copy link
Contributor

@AustinAbro321 AustinAbro321 left a comment

Choose a reason for hiding this comment

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

LGTM

@Noxsios Noxsios merged commit b8c83c5 into main Mar 18, 2024
26 checks passed
@Noxsios Noxsios deleted the 2372-lib-configure-pterm-output-during-deploy-lifecycle branch March 18, 2024 20:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Done
Status: Approved
Development

Successfully merging this pull request may close these issues.

lib: configure pterm output during Deploy lifecycle
2 participants