[Dancer-users] Invalid value for log config

Alexis Sukrieh sukria at sukria.net
Thu Dec 16 19:06:12 CET 2010


Hi,

Le 15/12/2010 10:30, sawyer x a écrit :
> Generally, you're suggesting a good feature. Having build-time checks of
> correct values/keys is important, but we still want to have users be
> able to provide their own keys and values.

Indeed, validating Dancer-native parameters is a good idea. We want to 
let the user use the config file for their personal use though.

> This is what helps make
> Dancer MVC-ish, because you can separate the view and model information
> in your configuration using any number of plugins or even in-house code
> for it.
>
> A possible solution would be to:
> 1. add a special key in the hash for user-defined information

I like the idea to introduce a "namespace" for user-defined parameters, 
but that would be hardly backward-compliant...

We already have a "plugins" namespace and an "engine" one, so I suppose 
it definitely makes sense to add namespace, whose name would be the 
appname, for instance:

# config.yml
appname: "fooapp"
logger: "console"
...

plugins:
    ....
engines:
    ....

fooapp:
    some_user_defined_var: 42
    ...

Anything that is defined in the top-level would be considered Dancer's 
core property.

This would allow for specific checks, and could protect users from using 
a key that would become Dancer-native in future versions.

I like that idea, but my main concern here is backward-compat, as I said...

-- 
Alexis Sukrieh


More information about the Dancer-users mailing list