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

Extend logging and verbosity options #2693

Merged
merged 6 commits into from Jan 15, 2023
Merged

Conversation

dawedawe
Copy link
Member

@dawedawe dawedawe commented Jan 6, 2023

To show the general direction and maybe get some feedback, here's an early draft for the logging feature:
--verbosity d should be the same as in the past with the addition of the count of processed files in the end
--verbosity n should be pretty quiet

Fixes #2627

--verbosity d should be the same as in the past
--verbosity n should be pretty quiet
@dawedawe dawedawe changed the title Logging. Extend logging and verbosity options Jan 6, 2023
Copy link
Contributor

@nojaf nojaf left a comment

Choose a reason for hiding this comment

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

This looks good so far!
I would be a little more consistent when using the logger functions. Just always go with an interpolated string. But that is really a nit.

I also think we should keep this for v6. Just to be on the safe side and get some user feedback.

src/Fantomas/IgnoreFile.fs Outdated Show resolved Hide resolved
src/Fantomas/Program.fs Outdated Show resolved Hide resolved
src/Fantomas/Program.fs Outdated Show resolved Hide resolved
src/Fantomas/Program.fs Outdated Show resolved Hide resolved
@dawedawe
Copy link
Member Author

This looks good so far! I would be a little more consistent when using the logger functions. Just always go with an interpolated string. But that is really a nit.

I also think we should keep this for v6. Just to be on the safe side and get some user feedback.

Thanks for the review. Waiting for v6 is fine for me.

@nojaf
Copy link
Contributor

nojaf commented Jan 15, 2023

I created a https://github.com/fsprojects/fantomas/tree/v6.0 branch which you can use to target this PR.

@dawedawe dawedawe changed the base branch from main to v6.0 January 15, 2023 11:28
@dawedawe dawedawe marked this pull request as ready for review January 15, 2023 12:26
@dawedawe
Copy link
Member Author

If this is okay, I'd like to merge this, so Jimmy and me run into less conflicts with our next steps.
I'm thinking about the changes needed to report in the end how many files failed and how many were good...

Copy link
Contributor

@nojaf nojaf left a comment

Choose a reason for hiding this comment

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

I think this is indeed ok to have as is now and revisit later.
Some food for thought:

  • Do we not want to show the user which file was formatted? I think this makes sense in normal logging.
  • Should we free up -v for verbosity? It is current used for version. It might make sense to use it for verbosity instead.
  • We will need to think about the format of logging. Seeing [15:21:11 INF] might be a bit misleading when detailed is active.

@nojaf nojaf merged commit 1c2d6dd into fsprojects:v6.0 Jan 15, 2023
@dawedawe
Copy link
Member Author

I think this is indeed ok to have as is now and revisit later. Some food for thought:

* Do we not want to show the user which file was formatted? I think this makes sense in normal logging.

* Should we free up `-v` for verbosity? It is current used for version. It might make sense to use it for verbosity instead.

* We will need to think about the format of logging. Seeing `[15:21:11 INF]` might be a bit misleading when `detailed` is active.

Thanks a lot, I'll work on these.

nojaf pushed a commit that referenced this pull request Jan 19, 2023
* First stab at logging.
--verbosity d should be the same as in the past
--verbosity n should be pretty quiet

* Make use of Serilog

* improve test specificity

* add log messages about count of processed files

* Use interpolated strings for all logger functions.
Change some logs to be error logs.
nojaf pushed a commit that referenced this pull request Jan 20, 2023
…le (#2728)

* Extend logging and verbosity options (#2693)

* First stab at logging.
--verbosity d should be the same as in the past
--verbosity n should be pretty quiet

* Make use of Serilog

* improve test specificity

* add log messages about count of processed files

* Use interpolated strings for all logger functions.
Change some logs to be error logs.

* remove MultilineBlockBracketsOnSameColumn & ExperimentalStroustrupStyle from src/

* remove MultilineBlockBracketsOnSameColumn & ExperimentalStroustrupStyle from Rider.md

* remove MultilineBlockBracketsOnSameColumn & ExperimentalStroustrupStyle from Configuration.fsx

* remove orange (use with caution) marker from fsharp_multiline_bracket_style
nojaf pushed a commit that referenced this pull request Jan 20, 2023
* First stab at logging.
--verbosity d should be the same as in the past
--verbosity n should be pretty quiet

* Make use of Serilog

* improve test specificity

* add log messages about count of processed files

* Use interpolated strings for all logger functions.
Change some logs to be error logs.
nojaf pushed a commit that referenced this pull request Jan 20, 2023
…le (#2728)

* Extend logging and verbosity options (#2693)

* First stab at logging.
--verbosity d should be the same as in the past
--verbosity n should be pretty quiet

* Make use of Serilog

* improve test specificity

* add log messages about count of processed files

* Use interpolated strings for all logger functions.
Change some logs to be error logs.

* remove MultilineBlockBracketsOnSameColumn & ExperimentalStroustrupStyle from src/

* remove MultilineBlockBracketsOnSameColumn & ExperimentalStroustrupStyle from Rider.md

* remove MultilineBlockBracketsOnSameColumn & ExperimentalStroustrupStyle from Configuration.fsx

* remove orange (use with caution) marker from fsharp_multiline_bracket_style
nojaf pushed a commit that referenced this pull request Jan 24, 2023
* First stab at logging.
--verbosity d should be the same as in the past
--verbosity n should be pretty quiet

* Make use of Serilog

* improve test specificity

* add log messages about count of processed files

* Use interpolated strings for all logger functions.
Change some logs to be error logs.
nojaf pushed a commit that referenced this pull request Jan 24, 2023
…le (#2728)

* Extend logging and verbosity options (#2693)

* First stab at logging.
--verbosity d should be the same as in the past
--verbosity n should be pretty quiet

* Make use of Serilog

* improve test specificity

* add log messages about count of processed files

* Use interpolated strings for all logger functions.
Change some logs to be error logs.

* remove MultilineBlockBracketsOnSameColumn & ExperimentalStroustrupStyle from src/

* remove MultilineBlockBracketsOnSameColumn & ExperimentalStroustrupStyle from Rider.md

* remove MultilineBlockBracketsOnSameColumn & ExperimentalStroustrupStyle from Configuration.fsx

* remove orange (use with caution) marker from fsharp_multiline_bracket_style
@nojaf nojaf mentioned this pull request Jan 30, 2023
nojaf pushed a commit that referenced this pull request Feb 3, 2023
* First stab at logging.
--verbosity d should be the same as in the past
--verbosity n should be pretty quiet

* Make use of Serilog

* improve test specificity

* add log messages about count of processed files

* Use interpolated strings for all logger functions.
Change some logs to be error logs.
nojaf pushed a commit that referenced this pull request Feb 3, 2023
…le (#2728)

* Extend logging and verbosity options (#2693)

* First stab at logging.
--verbosity d should be the same as in the past
--verbosity n should be pretty quiet

* Make use of Serilog

* improve test specificity

* add log messages about count of processed files

* Use interpolated strings for all logger functions.
Change some logs to be error logs.

* remove MultilineBlockBracketsOnSameColumn & ExperimentalStroustrupStyle from src/

* remove MultilineBlockBracketsOnSameColumn & ExperimentalStroustrupStyle from Rider.md

* remove MultilineBlockBracketsOnSameColumn & ExperimentalStroustrupStyle from Configuration.fsx

* remove orange (use with caution) marker from fsharp_multiline_bracket_style
nojaf pushed a commit that referenced this pull request Feb 4, 2023
* First stab at logging.
--verbosity d should be the same as in the past
--verbosity n should be pretty quiet

* Make use of Serilog

* improve test specificity

* add log messages about count of processed files

* Use interpolated strings for all logger functions.
Change some logs to be error logs.
nojaf pushed a commit that referenced this pull request Feb 4, 2023
…le (#2728)

* Extend logging and verbosity options (#2693)

* First stab at logging.
--verbosity d should be the same as in the past
--verbosity n should be pretty quiet

* Make use of Serilog

* improve test specificity

* add log messages about count of processed files

* Use interpolated strings for all logger functions.
Change some logs to be error logs.

* remove MultilineBlockBracketsOnSameColumn & ExperimentalStroustrupStyle from src/

* remove MultilineBlockBracketsOnSameColumn & ExperimentalStroustrupStyle from Rider.md

* remove MultilineBlockBracketsOnSameColumn & ExperimentalStroustrupStyle from Configuration.fsx

* remove orange (use with caution) marker from fsharp_multiline_bracket_style
nojaf pushed a commit that referenced this pull request Feb 22, 2023
* First stab at logging.
--verbosity d should be the same as in the past
--verbosity n should be pretty quiet

* Make use of Serilog

* improve test specificity

* add log messages about count of processed files

* Use interpolated strings for all logger functions.
Change some logs to be error logs.
nojaf pushed a commit that referenced this pull request Feb 22, 2023
…le (#2728)

* Extend logging and verbosity options (#2693)

* First stab at logging.
--verbosity d should be the same as in the past
--verbosity n should be pretty quiet

* Make use of Serilog

* improve test specificity

* add log messages about count of processed files

* Use interpolated strings for all logger functions.
Change some logs to be error logs.

* remove MultilineBlockBracketsOnSameColumn & ExperimentalStroustrupStyle from src/

* remove MultilineBlockBracketsOnSameColumn & ExperimentalStroustrupStyle from Rider.md

* remove MultilineBlockBracketsOnSameColumn & ExperimentalStroustrupStyle from Configuration.fsx

* remove orange (use with caution) marker from fsharp_multiline_bracket_style
nojaf pushed a commit that referenced this pull request Mar 17, 2023
* First stab at logging.
--verbosity d should be the same as in the past
--verbosity n should be pretty quiet

* Make use of Serilog

* improve test specificity

* add log messages about count of processed files

* Use interpolated strings for all logger functions.
Change some logs to be error logs.
nojaf pushed a commit that referenced this pull request Mar 17, 2023
…le (#2728)

* Extend logging and verbosity options (#2693)

* First stab at logging.
--verbosity d should be the same as in the past
--verbosity n should be pretty quiet

* Make use of Serilog

* improve test specificity

* add log messages about count of processed files

* Use interpolated strings for all logger functions.
Change some logs to be error logs.

* remove MultilineBlockBracketsOnSameColumn & ExperimentalStroustrupStyle from src/

* remove MultilineBlockBracketsOnSameColumn & ExperimentalStroustrupStyle from Rider.md

* remove MultilineBlockBracketsOnSameColumn & ExperimentalStroustrupStyle from Configuration.fsx

* remove orange (use with caution) marker from fsharp_multiline_bracket_style
nojaf pushed a commit that referenced this pull request Mar 27, 2023
* First stab at logging.
--verbosity d should be the same as in the past
--verbosity n should be pretty quiet

* Make use of Serilog

* improve test specificity

* add log messages about count of processed files

* Use interpolated strings for all logger functions.
Change some logs to be error logs.
nojaf pushed a commit that referenced this pull request Mar 27, 2023
…le (#2728)

* Extend logging and verbosity options (#2693)

* First stab at logging.
--verbosity d should be the same as in the past
--verbosity n should be pretty quiet

* Make use of Serilog

* improve test specificity

* add log messages about count of processed files

* Use interpolated strings for all logger functions.
Change some logs to be error logs.

* remove MultilineBlockBracketsOnSameColumn & ExperimentalStroustrupStyle from src/

* remove MultilineBlockBracketsOnSameColumn & ExperimentalStroustrupStyle from Rider.md

* remove MultilineBlockBracketsOnSameColumn & ExperimentalStroustrupStyle from Configuration.fsx

* remove orange (use with caution) marker from fsharp_multiline_bracket_style
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.

[Feature request] Less verbose output
2 participants