kivy/kivy — pull request #2167 by matham (2014-05-08 03:05:06+00:00)
Title: Add config callback to change the log file when the config log_dir/log_name change.

Fixes #2165.

You can test it with this example code:

```
from kivy.lang import Builder
from kivy.app import runTouchApp

kv = '''
#:import Config kivy.config.Config
#:import Logger kivy.logger.Logger
BoxLayout:
orientation: 'vertical'
TextInput:
id: text
Button:
text: 'Update file'
on_press: Config.set('kivy', 'log_name', text.text)
Button:
on_press: Logger.warning('Whatevs: a warning to you')
text: 'emit warning'
'''

runTouchApp(Builder.load_string(kv))
```
There is a slight thing, when we import Config, some stuff already goes to the current log so when you then change the log file, it'll miss some lines. However, changing the config file directly before loading kivy will resolve that.