mschilli / log4perl

Log4j Implementation For Perl
http://log4perl.com
Other
116 stars 66 forks source link

Using dots in property configuration names #108

Open doojonio opened 3 years ago

doojonio commented 3 years ago

Hi, I am using property configuration. And now I need to use dots in names for some fields. For example:

JsonLayout.field.browser.name = Firefox

In this case I want to get field like that:

field->{'browser.name'} == 'Firefox'

So I propose to use some char sequence as dot. For example if we gonna use '~1' char sequence as dot, than configuration, which will look like this:

JsonLayout.field.browser~1name = Firefox

And field hash will look like this:

field->{'browser.name'} == 'Firefox'

Can we do this? I can create pull request for this, if you like this idea

mohawk2 commented 2 years ago

I think you'd be able to have this right now with the code as it is, if you just use e.g. _ to be your escape character, with __ as literal underscore, then _1A3_ be the hexadecimal escape "1A3"? (and obviously decode that where you need to do so)