trevordevore / levure

Application development framework for LiveCode
MIT License
32 stars 14 forks source link

logger: Different Targets For Different Log Types #146

Open macMikey opened 5 years ago

macMikey commented 5 years ago

Example: developer messages go to one file, errors to another file. Then you can have multiple log windows open tracking the different message types.

macMikey commented 5 years ago

Thinking aloud, since I'm starting to tackle this: We should be able to customize all the settings for a type (but I think the main thing that would be changed for a type would be the target). If the type isn't specified when making a setting change, it would apply to all. I think there should be an option for setting all and default, too. The logger section of the app.yml file would thus be changed to add an extra level below type[s] for all of the settings. In app.yml you would have

logger:
   type: error
      target: "~/Desktop/logs/errlog.log"
      include log type: false
   type: cron,developer
      target: "~/Desktop/logs/myApp.log"
   type: default
      target: msg
      column delimiter: 124

If we didn't want the droves of developers who are using their app.yml file to configure logger to have to make modifications, we could make the extra levels optional, and if there were no levels below type[s], it would mean the settings applied to all. That seems like it would be confusing, though, so I think if we are to add this we should just tell the tens of thousands of developers to suffer through and carry on.