Skip to content

Custom script, config context or multiline log output #10426

Answered by candlerb
mickmortensen asked this question in Q&A
Discussion options

You must be logged in to vote

I have gotten the script to output the config in the self.log_success, but i cannot figure out a way to line break the output.

Don't use log_xxx; your script can simply return a string, and this can contain newlines.

See the example, which returns a CSV file.

Config contexts aren't really intended for whole config files. They are JSON data intended to store parameters, which could be used to build a configuration. In theory, I suppose you could store

{"configuration":"some..very..long..string..with..the..whole..configuration"}

Maybe you'd be better off with a custom field, although I don't know if there's a maximum length for those.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@mickmortensen
Comment options

Answer selected by mickmortensen
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants