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

Add logging and verbose output #3

Open
rakshasa opened this issue Dec 30, 2021 · 4 comments
Open

Add logging and verbose output #3

rakshasa opened this issue Dec 30, 2021 · 4 comments

Comments

@rakshasa
Copy link
Owner

No description provided.

@rakshasa
Copy link
Owner Author

Output filename when output to file unless set to silent.

@joshterrill
Copy link

Is this block of code where you're talking about implementing verbose filename output logging?

switch outputType {
case fileOutputTypeName:
if len(outputValue) == 0 {
return nil, fmt.Errorf("missing valid output destination")
}
return outputs.NewSingleOutput(opts.defaultEncodeFn, outputs.NewFileOutput(outputValue)), nil
case fileOutputWithInplaceTypeName:
return outputs.NewSingleOutput(opts.defaultEncodeFn, outputs.NewInplaceFileOutput()), nil
case fileOutputWithTemplateFilenameTypeName:
if len(outputValue) == 0 {
return nil, fmt.Errorf("missing valid output destination")
}
return outputs.NewSingleOutput(opts.defaultEncodeFn, outputs.NewFileOutputWithTemplateFilename(outputValue)), nil
case printTemplateTypeName:
if len(encodeValue) == 0 {
return nil, fmt.Errorf("missing valid print template")
}
return outputs.NewSingleOutput(encodings.NewEncodePrintTemplate(encodeValue), outputs.NewStandardOutput()), nil
case "":
if opts.defaultOutputFn == nil {
return nil, fmt.Errorf("unexpected missing default output")
}
return outputs.NewSingleOutput(opts.defaultEncodeFn, opts.defaultOutputFn), nil
default:
return nil, fmt.Errorf("unknown output destination type: %s", outputType)
}

@rakshasa
Copy link
Owner Author

A while ago since I wrote it, but does look reasonable.

@joshterrill
Copy link

I'm using this and thought that this would also be useful, so once I saw an issue on it, I figured I'd just submit a PR if it still needed to be done. I'll should have some time in the next few days to look at it.

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

No branches or pull requests

2 participants