{"action":"created","issue":{"url":"https://api.github.com/repos/domokit/mojo/issues/480","labels_url":"https://api.github.com/repos/domokit/mojo/issues/480/labels{/name}","comments_url":"https://api.github.com/repos/domokit/mojo/issues/480/comments","events_url":"https://api.github.com/repos/domokit/mojo/issues/480/events","html_url":"https://github.com/domokit/mojo/issues/480","id":112245792,"number":480,"title":"The Mojom compiler should generate debug print functions for mojom types.","user":{"login":"j9brown","id":102276,"avatar_url":"https://avatars.githubusercontent.com/u/102276?v=3","gravatar_id":"","url":"https://api.github.com/users/j9brown","html_url":"https://github.com/j9brown","followers_url":"https://api.github.com/users/j9brown/followers","following_url":"https://api.github.com/users/j9brown/following{/other_user}","gists_url":"https://api.github.com/users/j9brown/gists{/gist_id}","starred_url":"https://api.github.com/users/j9brown/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/j9brown/subscriptions","organizations_url":"https://api.github.com/users/j9brown/orgs","repos_url":"https://api.github.com/users/j9brown/repos","events_url":"https://api.github.com/users/j9brown/events{/privacy}","received_events_url":"https://api.github.com/users/j9brown/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-10-19T22:26:57Z","updated_at":"2015-10-19T23:32:20Z","closed_at":null,"body":"It would be super-useful if the Mojom compiler could be asked to provide default implementations of print functions for Mojom generated types, ie. operator <<(ostream&, ...) in C++ or toString() in other languages.\r\n\r\nI'm finding myself writing code like this to help in debugging.  It's not hard but it would be handy if Mojom could write it for me and strip it out if unused.\r\n\r\n```cpp\r\nstatic std::ostream& operator<<(std::ostream& os,\r\n                                mojo::ui::BoxConstraints* constraints) {\r\n  return constraints\r\n             ? os << \"{min_width=\" << constraints->min_width\r\n                  << \", max_width=\" << constraints->max_width\r\n                  << \", min_height=\" << constraints->min_height\r\n                  << \", max_height=\" << constraints->max_height << \"}\"\r\n             : os << \"{null}\";\r\n};\r\n```"},"comment":{"url":"https://api.github.com/repos/domokit/mojo/issues/comments/149376256","html_url":"https://github.com/domokit/mojo/issues/480#issuecomment-149376256","issue_url":"https://api.github.com/repos/domokit/mojo/issues/480","id":149376256,"user":{"login":"j9brown","id":102276,"avatar_url":"https://avatars.githubusercontent.com/u/102276?v=3","gravatar_id":"","url":"https://api.github.com/users/j9brown","html_url":"https://github.com/j9brown","followers_url":"https://api.github.com/users/j9brown/followers","following_url":"https://api.github.com/users/j9brown/following{/other_user}","gists_url":"https://api.github.com/users/j9brown/gists{/gist_id}","starred_url":"https://api.github.com/users/j9brown/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/j9brown/subscriptions","organizations_url":"https://api.github.com/users/j9brown/orgs","repos_url":"https://api.github.com/users/j9brown/repos","events_url":"https://api.github.com/users/j9brown/events{/privacy}","received_events_url":"https://api.github.com/users/j9brown/received_events","type":"User","site_admin":false},"created_at":"2015-10-19T23:32:20Z","updated_at":"2015-10-19T23:32:20Z","body":"That could certainly be useful too.  We should open up a separate bug for it.  It could be built on top of the new mojom metadata service interfaces, if I understand them correctly."}}