{"action":"created","issue":{"url":"https://api.github.com/repos/cinder/Cinder/issues/712","labels_url":"https://api.github.com/repos/cinder/Cinder/issues/712/labels{/name}","comments_url":"https://api.github.com/repos/cinder/Cinder/issues/712/comments","events_url":"https://api.github.com/repos/cinder/Cinder/issues/712/events","html_url":"https://github.com/cinder/Cinder/pull/712","id":57867406,"number":712,"title":"Added log appending, daily rotating log, moved NSLog to syslog","user":{"login":"lucasvickers","id":1099950,"avatar_url":"https://avatars.githubusercontent.com/u/1099950?v=3","gravatar_id":"","url":"https://api.github.com/users/lucasvickers","html_url":"https://github.com/lucasvickers","followers_url":"https://api.github.com/users/lucasvickers/followers","following_url":"https://api.github.com/users/lucasvickers/following{/other_user}","gists_url":"https://api.github.com/users/lucasvickers/gists{/gist_id}","starred_url":"https://api.github.com/users/lucasvickers/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lucasvickers/subscriptions","organizations_url":"https://api.github.com/users/lucasvickers/orgs","repos_url":"https://api.github.com/users/lucasvickers/repos","events_url":"https://api.github.com/users/lucasvickers/events{/privacy}","received_events_url":"https://api.github.com/users/lucasvickers/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-02-17T00:15:20Z","updated_at":"2015-03-03T11:35:06Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/cinder/Cinder/pulls/712","html_url":"https://github.com/cinder/Cinder/pull/712","diff_url":"https://github.com/cinder/Cinder/pull/712.diff","patch_url":"https://github.com/cinder/Cinder/pull/712.patch"},"body":"Generally I like the straight forward logging technique.  I think we can get enough basic functionality out of it, and if we expose the logs to syslog and eventlog we can tie into more advanced reporting systems for production rollouts.\r\n\r\n##### I've added a few features:\r\n* Added log appending and set to true as default.  \r\n  * I'm open to changing the default to false, but for a rollout with an auto-restart tool we'd want to append to the old logs in case of crash, etc.\r\n* Added a daily rotating log.  \r\n  * I gave an overloaded ```enableFileLogging``` function to keep the interface simple, and the user must provide a ```strftime``` formatted string for the log file.  There is no verification on this, and the log rolls daily independent of the ```strftime``` format.\r\n  * Perhaps future control of log rolling granularity (weeks, days, hours) could be nice.\r\n* I wrote a ```LoggerSysLog``` class that writes to the syslog.  \r\n  * I let the user change the SystemLoggingLevel, but standard system /etc/asl.conf configurations will ignore anything below Warning.  This differs slightly from what ```NSLog``` was doing (all levels in the system.log).  This is normal behavior, and syslog shouldn't be for debug information unless you have a reason and specifically configure it.\r\n  * In ```LoggerSysLog::LoggerSysLog()``` I get the logging name from ```NSFileManager```.  There may be a more cinder oriented way to get a logging name (app name of sorts).\r\n\r\n##### Example usages:\r\n```\r\nlog::manager()->enableFileLogging(\"/tmp\", \"loggingTests.%Y.%m.%d.log\", false);\r\nOR\r\nlog::manager()->enableFileLogging(\"/tmp/cinder.log\", true);\r\n\r\nlog::manager()->enableSystemLogging();\r\nlog::manager()->setSystemLoggingLevel(log::LEVEL_ERROR);\r\n```\r\n##### What I would like to add later:\r\n* Windows EventLog for system logging in windows.\r\n* I do conversion from the ```ci::log::LEVEL``` enums to ```syslog::LEVEL``` in a few places, I'd like to combine these somehow.\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/cinder/Cinder/issues/comments/76929988","html_url":"https://github.com/cinder/Cinder/pull/712#issuecomment-76929988","issue_url":"https://api.github.com/repos/cinder/Cinder/issues/712","id":76929988,"user":{"login":"richardeakin","id":5132127,"avatar_url":"https://avatars.githubusercontent.com/u/5132127?v=3","gravatar_id":"","url":"https://api.github.com/users/richardeakin","html_url":"https://github.com/richardeakin","followers_url":"https://api.github.com/users/richardeakin/followers","following_url":"https://api.github.com/users/richardeakin/following{/other_user}","gists_url":"https://api.github.com/users/richardeakin/gists{/gist_id}","starred_url":"https://api.github.com/users/richardeakin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/richardeakin/subscriptions","organizations_url":"https://api.github.com/users/richardeakin/orgs","repos_url":"https://api.github.com/users/richardeakin/repos","events_url":"https://api.github.com/users/richardeakin/events{/privacy}","received_events_url":"https://api.github.com/users/richardeakin/received_events","type":"User","site_admin":false},"created_at":"2015-03-03T11:35:06Z","updated_at":"2015-03-03T11:35:06Z","body":"Hm, don't know what I did with that previous link, but DebugTest is in glNext branch [here](https://github.com/cinder/Cinder/blob/glNext/test/DebugTest/src/DebugTestApp.cpp)."}}