{"action":"created","issue":{"url":"https://api.github.com/repos/SwiftyBeaver/SwiftyBeaver/issues/89","repository_url":"https://api.github.com/repos/SwiftyBeaver/SwiftyBeaver","labels_url":"https://api.github.com/repos/SwiftyBeaver/SwiftyBeaver/issues/89/labels{/name}","comments_url":"https://api.github.com/repos/SwiftyBeaver/SwiftyBeaver/issues/89/comments","events_url":"https://api.github.com/repos/SwiftyBeaver/SwiftyBeaver/issues/89/events","html_url":"https://github.com/SwiftyBeaver/SwiftyBeaver/pull/89","id":149618972,"number":89,"title":"Ns log instead of print","user":{"login":"mishagray","id":303665,"avatar_url":"https://avatars.githubusercontent.com/u/303665?v=3","gravatar_id":"","url":"https://api.github.com/users/mishagray","html_url":"https://github.com/mishagray","followers_url":"https://api.github.com/users/mishagray/followers","following_url":"https://api.github.com/users/mishagray/following{/other_user}","gists_url":"https://api.github.com/users/mishagray/gists{/gist_id}","starred_url":"https://api.github.com/users/mishagray/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mishagray/subscriptions","organizations_url":"https://api.github.com/users/mishagray/orgs","repos_url":"https://api.github.com/users/mishagray/repos","events_url":"https://api.github.com/users/mishagray/events{/privacy}","received_events_url":"https://api.github.com/users/mishagray/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-04-20T00:23:18Z","updated_at":"2016-04-20T09:44:28Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/SwiftyBeaver/SwiftyBeaver/pulls/89","html_url":"https://github.com/SwiftyBeaver/SwiftyBeaver/pull/89","diff_url":"https://github.com/SwiftyBeaver/SwiftyBeaver/pull/89.diff","patch_url":"https://github.com/SwiftyBeaver/SwiftyBeaver/pull/89.patch"},"body":"Some things I piled up into a single PR.\r\n\r\nIn general I would have been nice and pushed each one separate. (But I have a horrible work deadline and zero time).\r\n\r\nI'm using this branch in production right now (for an Enterprise app).  Seems fine.\r\n\r\nThere are a few features.\r\n\r\n1 --\r\nInstead of assuming a queue, I replaced it with a  logical 'executionContext' and allowed for 'immediateExecution' and custom execution contexts, custom queues per destination etc.\r\nBy default, the logic will behave the exact same (dispatch_async to a serial queue). \r\n\r\nvar queue: dispatch_queue_t? \r\nis now\r\nvar executionContext\r\n\r\nThe old 'asynchronous' var is now 'computed' to just modify the executionContext (if possible).\r\nThe old queue\r\n\r\nAs part of that ... I deprecated ```flush()``` in favor of an async version ```flushAsync(flushDone: dispatch_block_t)```.   Which will let people perform flushes asynchronously as needed.  The old version should still work (but Destinations should only implement one or the other!).    I'm not sure the current code works right if you have sync = true on a Destination and false on another, and try to flush both.  The FlushAsync() is just safer.  \r\n\r\n2--  Support for print/NSLog/Custom  via ConsoleLogger.\r\nThere is also a way to configure ConsoleDestination to use any custom OutputStreamType by mapping it to the build in swift print generic that takes a OutputStreamType. \r\n\r\n3 - small optimization to only 'build' the log output ONCE, even if you have multiple destinations.   So we only execute the \r\n\r\n\r\nIf you want some of this stuff and not take all of it... I can cherrypick the stuff out next week when I have some time.\r\n\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/SwiftyBeaver/SwiftyBeaver/issues/comments/212353948","html_url":"https://github.com/SwiftyBeaver/SwiftyBeaver/pull/89#issuecomment-212353948","issue_url":"https://api.github.com/repos/SwiftyBeaver/SwiftyBeaver/issues/89","id":212353948,"user":{"login":"skreutzberger","id":564725,"avatar_url":"https://avatars.githubusercontent.com/u/564725?v=3","gravatar_id":"","url":"https://api.github.com/users/skreutzberger","html_url":"https://github.com/skreutzberger","followers_url":"https://api.github.com/users/skreutzberger/followers","following_url":"https://api.github.com/users/skreutzberger/following{/other_user}","gists_url":"https://api.github.com/users/skreutzberger/gists{/gist_id}","starred_url":"https://api.github.com/users/skreutzberger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/skreutzberger/subscriptions","organizations_url":"https://api.github.com/users/skreutzberger/orgs","repos_url":"https://api.github.com/users/skreutzberger/repos","events_url":"https://api.github.com/users/skreutzberger/events{/privacy}","received_events_url":"https://api.github.com/users/skreutzberger/received_events","type":"User","site_admin":false},"created_at":"2016-04-20T09:44:28Z","updated_at":"2016-04-20T09:44:28Z","body":"Thanks! About NSLog: I tried to customize the output of NSLog to match at least a bit the custom format used by print() but struggled. It seems we need to use NSLogv instead to be able to get rid of all additional NSLog output and just use our already formatted output.\r\n\r\nUnfortunately NSLogv gives me gray hairs with its C-style documentation. \r\n\r\nAs a quick win I added a useNSLog property to ConsoleDestination but it would be great if we could completely replace print with a colored, custom NSLogv."}}