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

Too much curly brackets in warning when using #playpen #1295

Closed
FabienTregan opened this issue Aug 6, 2020 · 4 comments
Closed

Too much curly brackets in warning when using #playpen #1295

FabienTregan opened this issue Aug 6, 2020 · 4 comments

Comments

@FabienTregan
Copy link
Contributor

When using #playpen instead of #playground, a warning message is displayed during the building of the book:

the {{{{#playpen}}}} expression has been 
renamed to {{{{#playground}}}}, 
please update your book to use the new name

It shows four opening / closing curly brackets when two are needed.

I think I traced the problem down to the behavior of the log crate, I opened an issue but still open one here to remember to update log if the change is accepted, or to modify the message otherwise (it's there).

@ehuss
Copy link
Contributor

ehuss commented Aug 7, 2020

Hm, that's strange! I'm not seeing that:

2020-08-07 07:19:55 [WARN] (mdbook::preprocess::links): the {{#playpen}} expression has been renamed to {{#playground}}, please update your book to use the new name

This is with mdbook v0.4.1, which version are you using? Do you have the RUST_LOG environment variable set?

@FabienTregan
Copy link
Contributor Author

FabienTregan commented Aug 7, 2020

I did some more tests, and though I see four brackets with mdbook v0.4.1 installed with cargo, if I build from github (also saying mdbook v0.4.1) I have the correct output.

guess the issue can be closed.

Btw, I still have to understand why, though, because with:

[dependencies]
log = "0.4"
stderrlog = "0.4"

I can confirm that I still need to double the curly brackets if and only if I add some list of argument to the message (e.g.: warn!("this {{ needs to be doubled because of this {}.", "argument"))

Also from log code it seems that they just use the original string when there is no argument, so I don't understand why it works, nor the difference between the released and the github version. If you have any idea, I would be happy to spent some time figuring out this.

@FabienTregan
Copy link
Contributor Author

Some more information:
Cargo.tom requests log = 4.0, but because of Cargo.lock - which is under source control - pulls log 4.0.8 which doesn't have the problem.
When I tried to reproduce the problem on an isolated case, finally removed mdbook and just directly logged with I tried with log = 4.0.8, but without a Cargo.lock it locked on the 4.0.11,having this issue.

Could it be the case that the build process that make mdbook executable downloaded by cargo install mdbook ignores the erase the Cargo.lock file and used the 4.0.11 version of log ?

@ehuss
Copy link
Contributor

ehuss commented Aug 7, 2020

Ah, indeed, looks like an issue with the newer version of log.

cargo install defaults to ignoring Cargo.lock. cargo install mdbook --locked will use the versions of dependencies it was published with instead of the latest versions.

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