{"action":"created","issue":{"url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-golang/issues/255","repository_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-golang","labels_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-golang/issues/255/labels{/name}","comments_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-golang/issues/255/comments","events_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-golang/issues/255/events","html_url":"https://github.com/GoogleCloudPlatform/gcloud-golang/issues/255","id":154097992,"number":255,"title":"logging: sketch of an updated package","user":{"login":"jba","id":18483045,"avatar_url":"https://avatars.githubusercontent.com/u/18483045?v=3","gravatar_id":"","url":"https://api.github.com/users/jba","html_url":"https://github.com/jba","followers_url":"https://api.github.com/users/jba/followers","following_url":"https://api.github.com/users/jba/following{/other_user}","gists_url":"https://api.github.com/users/jba/gists{/gist_id}","starred_url":"https://api.github.com/users/jba/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jba/subscriptions","organizations_url":"https://api.github.com/users/jba/orgs","repos_url":"https://api.github.com/users/jba/repos","events_url":"https://api.github.com/users/jba/events{/privacy}","received_events_url":"https://api.github.com/users/jba/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2016-05-10T20:23:04Z","updated_at":"2016-05-11T01:37:16Z","closed_at":null,"body":"I'm planning on rewriting the existing Go client for the Stackdriver logging API. In addition to using the latest API version (v2beta1), I'd like to build the implementation on top of the Google API Code Generator library and expose more of the API's functionality.\r\n\r\nThe current Go client exports a Client type that includes connection and project information, as well as the log name. I'd like to bring the client more in line with the other languages by having a Client type responsible for networking and auth, and a separate Logger that holds the log name and other fields, like resource and common labels.\r\n\r\n(This change alone requires that we wrap the Code Generator library instead of using it directly or augmenting it, because I don't think a tool could come up with the Client/Logger split from the API alone.)\r\n\r\nThe Go client logs asynchronously. Calls to the main Log method add log entries to a queue and return immediately. I'd like to keep that behavior, but redo the implementation on top of the generated code, exploiting gax's support for retries. I'd also like to find a way to surface errors from the API calls; they are currently swallowed.\r\n\r\nThe Go client will continue to provide a way to get a standard log.Logger. I'll remove support to get an io.Writer, since that interface is too low-level. We'll tackle how best to support 3rd-party logging on a case-by-case basis. For example, logrus, a popular package, supports a hook interface that takes a log entry (not an io.Writer). We can provide a logrus hook in another package.\r\n\r\nI don't have much to say about the retrieval part of the API. I don't think having a nice veneer for it is as important as for the logging itself. At this point, I have no plans to do anything more than directly wrap the generated implementation.\r\n\r\nComments appreciated.\r\n"},"comment":{"url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-golang/issues/comments/218340006","html_url":"https://github.com/GoogleCloudPlatform/gcloud-golang/issues/255#issuecomment-218340006","issue_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-golang/issues/255","id":218340006,"user":{"login":"jba","id":18483045,"avatar_url":"https://avatars.githubusercontent.com/u/18483045?v=3","gravatar_id":"","url":"https://api.github.com/users/jba","html_url":"https://github.com/jba","followers_url":"https://api.github.com/users/jba/followers","following_url":"https://api.github.com/users/jba/following{/other_user}","gists_url":"https://api.github.com/users/jba/gists{/gist_id}","starred_url":"https://api.github.com/users/jba/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jba/subscriptions","organizations_url":"https://api.github.com/users/jba/orgs","repos_url":"https://api.github.com/users/jba/repos","events_url":"https://api.github.com/users/jba/events{/privacy}","received_events_url":"https://api.github.com/users/jba/received_events","type":"User","site_admin":false},"created_at":"2016-05-11T01:37:16Z","updated_at":"2016-05-11T01:37:16Z","body":"> Stackdriver has a logging API too?\r\n\r\nI believe that is the full name of the (one and only) logging API: https://cloud.google.com/logging.\r\n\r\n> Btw, we don't use the word \"class\" in Go. There are \"types\".\r\n\r\nFixed.\r\n\r\n> What is gax?\r\n\r\nA  [gRPC helper library](https://github.com/googleapis/gax-golang) used by the Google API Code Generator.\r\n\r\n> What's the difference between wrapping it and using it directly?\r\n\r\nThat was a bad choice of words. By using it directly I mean having the generated client library be the official preferred client for the API; not hand-writing any code at all. (You didn't ask, but by augmenting it I mean dropping hand-written code in the same package, so some of the surface would be generated and some wouldn't.)"}}