{"action":"created","issue":{"url":"https://api.github.com/repos/home-assistant/appdaemon/issues/39","repository_url":"https://api.github.com/repos/home-assistant/appdaemon","labels_url":"https://api.github.com/repos/home-assistant/appdaemon/issues/39/labels{/name}","comments_url":"https://api.github.com/repos/home-assistant/appdaemon/issues/39/comments","events_url":"https://api.github.com/repos/home-assistant/appdaemon/issues/39/events","html_url":"https://github.com/home-assistant/appdaemon/issues/39","id":205722295,"number":39,"title":"Appdaemon Pre-processor","user":{"login":"turboc1208","id":1900627,"avatar_url":"https://avatars3.githubusercontent.com/u/1900627?v=3","gravatar_id":"","url":"https://api.github.com/users/turboc1208","html_url":"https://github.com/turboc1208","followers_url":"https://api.github.com/users/turboc1208/followers","following_url":"https://api.github.com/users/turboc1208/following{/other_user}","gists_url":"https://api.github.com/users/turboc1208/gists{/gist_id}","starred_url":"https://api.github.com/users/turboc1208/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/turboc1208/subscriptions","organizations_url":"https://api.github.com/users/turboc1208/orgs","repos_url":"https://api.github.com/users/turboc1208/repos","events_url":"https://api.github.com/users/turboc1208/events{/privacy}","received_events_url":"https://api.github.com/users/turboc1208/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":6,"created_at":"2017-02-06T22:07:05Z","updated_at":"2017-03-10T14:12:01Z","closed_at":"2017-03-10T14:12:01Z","body":"The way you did the log files got me thinking.  It's almost a macro the way you did it.  How about a pre-processor that does simple string replacements into our code as it's loaded into appdaemon?  Here is why I am thinking this.  Continually typing \r\n\r\n`self.log(\"__function__ (__line__) here is my log entry\")`\r\nrepeat 20 or 30 times while debugging which arguably is when you need the function and line numbers the most.  It's a pain.\r\n\r\neven using a variable isn't much better.\r\n\r\n`self.log(self.func + \"(\"+self.line+\") \" + \"here is my log entry\") `\r\ndoesn't make it any better\r\n\r\nbut\r\n  typing Dlog(\"here is my log entry\")\r\nand having it replaced at run time with\r\n`self.log(\"__function__ (__line__) here is my log entry\")`\r\nwould be really cool.\r\n\r\nThe problem with making Dlog a local function is that they any function and line references it puts in the log would reference Dlog as the function so it has to be some type of code substitution.  \r\n\r\nMake sense??"},"comment":{"url":"https://api.github.com/repos/home-assistant/appdaemon/issues/comments/285678311","html_url":"https://github.com/home-assistant/appdaemon/issues/39#issuecomment-285678311","issue_url":"https://api.github.com/repos/home-assistant/appdaemon/issues/39","id":285678311,"user":{"login":"acockburn","id":9850788,"avatar_url":"https://avatars0.githubusercontent.com/u/9850788?v=3","gravatar_id":"","url":"https://api.github.com/users/acockburn","html_url":"https://github.com/acockburn","followers_url":"https://api.github.com/users/acockburn/followers","following_url":"https://api.github.com/users/acockburn/following{/other_user}","gists_url":"https://api.github.com/users/acockburn/gists{/gist_id}","starred_url":"https://api.github.com/users/acockburn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/acockburn/subscriptions","organizations_url":"https://api.github.com/users/acockburn/orgs","repos_url":"https://api.github.com/users/acockburn/repos","events_url":"https://api.github.com/users/acockburn/events{/privacy}","received_events_url":"https://api.github.com/users/acockburn/received_events","type":"User","site_admin":false},"created_at":"2017-03-10T14:12:01Z","updated_at":"2017-03-10T14:12:01Z","body":"I'm closing this - the original request for a preprocessor for Python code just just not how Python works, there are better ways to solve these types of problems."}}
{"actor":{"display_login":"acockburn"}}