sytsereitsma / mdbook-plantuml

mdBook preprocessor to render PlantUML diagrams to png images in the book output directory
MIT License
76 stars 14 forks source link

Customize logging #45

Closed mini-ninja-64 closed 1 year ago

mini-ninja-64 commented 2 years ago

I would like to configure the logging to output to stderr so it can be captured in logs without having to record a seperate output.log file

This made me think maybe it would be better to add support for the log4rs configuration files.

Would this be an acceptable pull request to raise against the project?

sytsereitsma commented 2 years ago

Thanks. What would you think about adding the logging into the rendered pages/code blocks?

mini-ninja-64 commented 2 years ago

Thats interesting, personally I would not find it useful, but it sounds cool.

I am unsure how I would implement it, I suppose you just create a logging appender that captures logs and then have those injected in the markdown, i guess you would reset the appender after processing each code block

I was thinking something more simple like this in the users mdbook toml:

[book]
authors = ["mini_ninja_64"]
language = "en"
multilingual = false
src = "src"
title = "example"

[preprocessor.plantuml]
enable-logging = true
logging-config = "./logging_config.yml"

where logging_config.yml would be a standard log4rs config file

I have a basic implementation of the above complete but since I am still new to rust I would do some extra clean up before opening a PR 😛

sytsereitsma commented 2 years ago

Maybe my idea was a bit silly. Just create a PR and I'll have a look.