{"action":"created","comment":{"url":"https://api.github.com/repos/RIOT-OS/RIOT/pulls/comments/25559487","id":25559487,"diff_hunk":"@@ -0,0 +1,49 @@\n+/*\n+ * Copyright 2015 Ludwig Ortmann <ludwig.ortmann@fu-berlin.de>\n+ *\n+ * This file is subject to the terms and conditions of the GNU Lesser\n+ * General Public License v2.1. See the file LICENSE in the top level\n+ * directory for more details.\n+ *\n+ */\n+\n+/**\n+ * @ingroup     core_log\n+ * @{\n+ *\n+ * @file\n+ * @brief       logging implementation that only prints the first argument\n+ *\n+ * @author      Ludwig Ortmann <ludwig.ortmann@fu-berlin.de>\n+ *\n+ * @}\n+ */\n+\n+#include <stdio.h>\n+#include <stdarg.h>\n+\n+#include \"log.h\"\n+\n+void log_info(const char *format, ...)\n+{\n+    putchar('I');\n+    putchar(':');\n+    putchar(' ');\n+    puts(format);","path":"sys/log/log_printfnoformat/log_printfnoformat.c","position":32,"original_position":32,"commit_id":"73bbed432cdaff0ef1516e86cb10e0d36f17bab1","original_commit_id":"c405565f20d303c5e9e1b6d0ce72c2f84e4be43c","user":{"login":"authmillenon","id":675644,"avatar_url":"https://avatars.githubusercontent.com/u/675644?v=3","gravatar_id":"","url":"https://api.github.com/users/authmillenon","html_url":"https://github.com/authmillenon","followers_url":"https://api.github.com/users/authmillenon/followers","following_url":"https://api.github.com/users/authmillenon/following{/other_user}","gists_url":"https://api.github.com/users/authmillenon/gists{/gist_id}","starred_url":"https://api.github.com/users/authmillenon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/authmillenon/subscriptions","organizations_url":"https://api.github.com/users/authmillenon/orgs","repos_url":"https://api.github.com/users/authmillenon/repos","events_url":"https://api.github.com/users/authmillenon/events{/privacy}","received_events_url":"https://api.github.com/users/authmillenon/received_events","type":"User","site_admin":false},"body":"(otherwise something like [in pseudo-code])\r\n\r\n```C\r\nwhile (va_next(elem)) {\r\n    switch (elem->type) {\r\n        case CHAR:\r\n            putchar('\\'');\r\n            putchar(elem->val);\r\n            putchar('\\'');\r\n            break;\r\n        case INT:\r\n            puts(itoa(elem->val));\r\n            break;\r\n        case LONG:\r\n            puts(ltoa(elem->val));\r\n            break;\r\n        /* etc .*/\r\n    }\r\n}\r\n```","created_at":"2015-02-28T17:49:21Z","updated_at":"2015-02-28T17:49:21Z","html_url":"https://github.com/RIOT-OS/RIOT/pull/2503#discussion_r25559487","pull_request_url":"https://api.github.com/repos/RIOT-OS/RIOT/pulls/2503","_links":{"self":{"href":"https://api.github.com/repos/RIOT-OS/RIOT/pulls/comments/25559487"},"html":{"href":"https://github.com/RIOT-OS/RIOT/pull/2503#discussion_r25559487"},"pull_request":{"href":"https://api.github.com/repos/RIOT-OS/RIOT/pulls/2503"}}},"pull_request":{"url":"https://api.github.com/repos/RIOT-OS/RIOT/pulls/2503","id":30222181,"html_url":"https://github.com/RIOT-OS/RIOT/pull/2503","diff_url":"https://github.com/RIOT-OS/RIOT/pull/2503.diff","patch_url":"https://github.com/RIOT-OS/RIOT/pull/2503.patch","issue_url":"https://api.github.com/repos/RIOT-OS/RIOT/issues/2503","number":2503,"state":"open","locked":false,"title":"core: add logging API","user":{"login":"LudwigOrtmann","id":3739173,"avatar_url":"https://avatars.githubusercontent.com/u/3739173?v=3","gravatar_id":"","url":"https://api.github.com/users/LudwigOrtmann","html_url":"https://github.com/LudwigOrtmann","followers_url":"https://api.github.com/users/LudwigOrtmann/followers","following_url":"https://api.github.com/users/LudwigOrtmann/following{/other_user}","gists_url":"https://api.github.com/users/LudwigOrtmann/gists{/gist_id}","starred_url":"https://api.github.com/users/LudwigOrtmann/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LudwigOrtmann/subscriptions","organizations_url":"https://api.github.com/users/LudwigOrtmann/orgs","repos_url":"https://api.github.com/users/LudwigOrtmann/repos","events_url":"https://api.github.com/users/LudwigOrtmann/events{/privacy}","received_events_url":"https://api.github.com/users/LudwigOrtmann/received_events","type":"User","site_admin":false},"body":"This PR specifies, implements, and partially adopts a minimalistic logging API.\r\n\r\nThere are two implementations, a macro based implementation which does not lead to any semantic or syntactic changes to current printf/puts based log messages, and a function call based implementation which only uses puts/putchar (thus potentially saving string formatting code).\r\n\r\nThe API has been applied to `/core`.\r\n\r\nFor the built-in implementation, **macros** have been chosen over:\r\n- **plain functions**, because current compilers were not able to remove empty function delcarations, thus leading to a static overhead of about 4 instructions for every log message (stack pushing, jumping, returning)\r\n- **static inline**, because it could lead to broken semantics due to inline `va_start` (variable argument handling is needed for printf)","created_at":"2015-02-28T09:55:27Z","updated_at":"2015-02-28T17:49:21Z","closed_at":null,"merged_at":null,"merge_commit_sha":"66f15b6ecbf975cf2a4b243cc539ddd056001251","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/RIOT-OS/RIOT/pulls/2503/commits","review_comments_url":"https://api.github.com/repos/RIOT-OS/RIOT/pulls/2503/comments","review_comment_url":"https://api.github.com/repos/RIOT-OS/RIOT/pulls/comments{/number}","comments_url":"https://api.github.com/repos/RIOT-OS/RIOT/issues/2503/comments","statuses_url":"https://api.github.com/repos/RIOT-OS/RIOT/statuses/73bbed432cdaff0ef1516e86cb10e0d36f17bab1","head":{"label":"LudwigOrtmann:pr/core-log","ref":"pr/core-log","sha":"73bbed432cdaff0ef1516e86cb10e0d36f17bab1","user":{"login":"LudwigOrtmann","id":3739173,"avatar_url":"https://avatars.githubusercontent.com/u/3739173?v=3","gravatar_id":"","url":"https://api.github.com/users/LudwigOrtmann","html_url":"https://github.com/LudwigOrtmann","followers_url":"https://api.github.com/users/LudwigOrtmann/followers","following_url":"https://api.github.com/users/LudwigOrtmann/following{/other_user}","gists_url":"https://api.github.com/users/LudwigOrtmann/gists{/gist_id}","starred_url":"https://api.github.com/users/LudwigOrtmann/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LudwigOrtmann/subscriptions","organizations_url":"https://api.github.com/users/LudwigOrtmann/orgs","repos_url":"https://api.github.com/users/LudwigOrtmann/repos","events_url":"https://api.github.com/users/LudwigOrtmann/events{/privacy}","received_events_url":"https://api.github.com/users/LudwigOrtmann/received_events","type":"User","site_admin":false},"repo":{"id":8590137,"name":"RIOT","full_name":"LudwigOrtmann/RIOT","owner":{"login":"LudwigOrtmann","id":3739173,"avatar_url":"https://avatars.githubusercontent.com/u/3739173?v=3","gravatar_id":"","url":"https://api.github.com/users/LudwigOrtmann","html_url":"https://github.com/LudwigOrtmann","followers_url":"https://api.github.com/users/LudwigOrtmann/followers","following_url":"https://api.github.com/users/LudwigOrtmann/following{/other_user}","gists_url":"https://api.github.com/users/LudwigOrtmann/gists{/gist_id}","starred_url":"https://api.github.com/users/LudwigOrtmann/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LudwigOrtmann/subscriptions","organizations_url":"https://api.github.com/users/LudwigOrtmann/orgs","repos_url":"https://api.github.com/users/LudwigOrtmann/repos","events_url":"https://api.github.com/users/LudwigOrtmann/events{/privacy}","received_events_url":"https://api.github.com/users/LudwigOrtmann/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/LudwigOrtmann/RIOT","description":"RIOT - The rum OS for the IoT ","fork":true,"url":"https://api.github.com/repos/LudwigOrtmann/RIOT","forks_url":"https://api.github.com/repos/LudwigOrtmann/RIOT/forks","keys_url":"https://api.github.com/repos/LudwigOrtmann/RIOT/keys{/key_id}","collaborators_url":"https://api.github.com/repos/LudwigOrtmann/RIOT/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/LudwigOrtmann/RIOT/teams","hooks_url":"https://api.github.com/repos/LudwigOrtmann/RIOT/hooks","issue_events_url":"https://api.github.com/repos/LudwigOrtmann/RIOT/issues/events{/number}","events_url":"https://api.github.com/repos/LudwigOrtmann/RIOT/events","assignees_url":"https://api.github.com/repos/LudwigOrtmann/RIOT/assignees{/user}","branches_url":"https://api.github.com/repos/LudwigOrtmann/RIOT/branches{/branch}","tags_url":"https://api.github.com/repos/LudwigOrtmann/RIOT/tags","blobs_url":"https://api.github.com/repos/LudwigOrtmann/RIOT/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/LudwigOrtmann/RIOT/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/LudwigOrtmann/RIOT/git/refs{/sha}","trees_url":"https://api.github.com/repos/LudwigOrtmann/RIOT/git/trees{/sha}","statuses_url":"https://api.github.com/repos/LudwigOrtmann/RIOT/statuses/{sha}","languages_url":"https://api.github.com/repos/LudwigOrtmann/RIOT/languages","stargazers_url":"https://api.github.com/repos/LudwigOrtmann/RIOT/stargazers","contributors_url":"https://api.github.com/repos/LudwigOrtmann/RIOT/contributors","subscribers_url":"https://api.github.com/repos/LudwigOrtmann/RIOT/subscribers","subscription_url":"https://api.github.com/repos/LudwigOrtmann/RIOT/subscription","commits_url":"https://api.github.com/repos/LudwigOrtmann/RIOT/commits{/sha}","git_commits_url":"https://api.github.com/repos/LudwigOrtmann/RIOT/git/commits{/sha}","comments_url":"https://api.github.com/repos/LudwigOrtmann/RIOT/comments{/number}","issue_comment_url":"https://api.github.com/repos/LudwigOrtmann/RIOT/issues/comments{/number}","contents_url":"https://api.github.com/repos/LudwigOrtmann/RIOT/contents/{+path}","compare_url":"https://api.github.com/repos/LudwigOrtmann/RIOT/compare/{base}...{head}","merges_url":"https://api.github.com/repos/LudwigOrtmann/RIOT/merges","archive_url":"https://api.github.com/repos/LudwigOrtmann/RIOT/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/LudwigOrtmann/RIOT/downloads","issues_url":"https://api.github.com/repos/LudwigOrtmann/RIOT/issues{/number}","pulls_url":"https://api.github.com/repos/LudwigOrtmann/RIOT/pulls{/number}","milestones_url":"https://api.github.com/repos/LudwigOrtmann/RIOT/milestones{/number}","notifications_url":"https://api.github.com/repos/LudwigOrtmann/RIOT/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/LudwigOrtmann/RIOT/labels{/name}","releases_url":"https://api.github.com/repos/LudwigOrtmann/RIOT/releases{/id}","created_at":"2013-03-05T22:01:42Z","updated_at":"2015-02-27T09:01:27Z","pushed_at":"2015-02-28T12:29:17Z","git_url":"git://github.com/LudwigOrtmann/RIOT.git","ssh_url":"git@github.com:LudwigOrtmann/RIOT.git","clone_url":"https://github.com/LudwigOrtmann/RIOT.git","svn_url":"https://github.com/LudwigOrtmann/RIOT","homepage":"https://github.com/RIOT-OS/RIOT/wiki","size":21271,"stargazers_count":1,"watchers_count":1,"language":"C","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":0,"forks":1,"open_issues":0,"watchers":1,"default_branch":"master"}},"base":{"label":"RIOT-OS:master","ref":"master","sha":"911bf20749704cc44998626c62b61a93782fa45b","user":{"login":"RIOT-OS","id":3079480,"avatar_url":"https://avatars.githubusercontent.com/u/3079480?v=3","gravatar_id":"","url":"https://api.github.com/users/RIOT-OS","html_url":"https://github.com/RIOT-OS","followers_url":"https://api.github.com/users/RIOT-OS/followers","following_url":"https://api.github.com/users/RIOT-OS/following{/other_user}","gists_url":"https://api.github.com/users/RIOT-OS/gists{/gist_id}","starred_url":"https://api.github.com/users/RIOT-OS/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RIOT-OS/subscriptions","organizations_url":"https://api.github.com/users/RIOT-OS/orgs","repos_url":"https://api.github.com/users/RIOT-OS/repos","events_url":"https://api.github.com/users/RIOT-OS/events{/privacy}","received_events_url":"https://api.github.com/users/RIOT-OS/received_events","type":"Organization","site_admin":false},"repo":{"id":7370241,"name":"RIOT","full_name":"RIOT-OS/RIOT","owner":{"login":"RIOT-OS","id":3079480,"avatar_url":"https://avatars.githubusercontent.com/u/3079480?v=3","gravatar_id":"","url":"https://api.github.com/users/RIOT-OS","html_url":"https://github.com/RIOT-OS","followers_url":"https://api.github.com/users/RIOT-OS/followers","following_url":"https://api.github.com/users/RIOT-OS/following{/other_user}","gists_url":"https://api.github.com/users/RIOT-OS/gists{/gist_id}","starred_url":"https://api.github.com/users/RIOT-OS/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RIOT-OS/subscriptions","organizations_url":"https://api.github.com/users/RIOT-OS/orgs","repos_url":"https://api.github.com/users/RIOT-OS/repos","events_url":"https://api.github.com/users/RIOT-OS/events{/privacy}","received_events_url":"https://api.github.com/users/RIOT-OS/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/RIOT-OS/RIOT","description":"RIOT -  The friendly OS for IoT","fork":false,"url":"https://api.github.com/repos/RIOT-OS/RIOT","forks_url":"https://api.github.com/repos/RIOT-OS/RIOT/forks","keys_url":"https://api.github.com/repos/RIOT-OS/RIOT/keys{/key_id}","collaborators_url":"https://api.github.com/repos/RIOT-OS/RIOT/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/RIOT-OS/RIOT/teams","hooks_url":"https://api.github.com/repos/RIOT-OS/RIOT/hooks","issue_events_url":"https://api.github.com/repos/RIOT-OS/RIOT/issues/events{/number}","events_url":"https://api.github.com/repos/RIOT-OS/RIOT/events","assignees_url":"https://api.github.com/repos/RIOT-OS/RIOT/assignees{/user}","branches_url":"https://api.github.com/repos/RIOT-OS/RIOT/branches{/branch}","tags_url":"https://api.github.com/repos/RIOT-OS/RIOT/tags","blobs_url":"https://api.github.com/repos/RIOT-OS/RIOT/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/RIOT-OS/RIOT/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/RIOT-OS/RIOT/git/refs{/sha}","trees_url":"https://api.github.com/repos/RIOT-OS/RIOT/git/trees{/sha}","statuses_url":"https://api.github.com/repos/RIOT-OS/RIOT/statuses/{sha}","languages_url":"https://api.github.com/repos/RIOT-OS/RIOT/languages","stargazers_url":"https://api.github.com/repos/RIOT-OS/RIOT/stargazers","contributors_url":"https://api.github.com/repos/RIOT-OS/RIOT/contributors","subscribers_url":"https://api.github.com/repos/RIOT-OS/RIOT/subscribers","subscription_url":"https://api.github.com/repos/RIOT-OS/RIOT/subscription","commits_url":"https://api.github.com/repos/RIOT-OS/RIOT/commits{/sha}","git_commits_url":"https://api.github.com/repos/RIOT-OS/RIOT/git/commits{/sha}","comments_url":"https://api.github.com/repos/RIOT-OS/RIOT/comments{/number}","issue_comment_url":"https://api.github.com/repos/RIOT-OS/RIOT/issues/comments{/number}","contents_url":"https://api.github.com/repos/RIOT-OS/RIOT/contents/{+path}","compare_url":"https://api.github.com/repos/RIOT-OS/RIOT/compare/{base}...{head}","merges_url":"https://api.github.com/repos/RIOT-OS/RIOT/merges","archive_url":"https://api.github.com/repos/RIOT-OS/RIOT/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/RIOT-OS/RIOT/downloads","issues_url":"https://api.github.com/repos/RIOT-OS/RIOT/issues{/number}","pulls_url":"https://api.github.com/repos/RIOT-OS/RIOT/pulls{/number}","milestones_url":"https://api.github.com/repos/RIOT-OS/RIOT/milestones{/number}","notifications_url":"https://api.github.com/repos/RIOT-OS/RIOT/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/RIOT-OS/RIOT/labels{/name}","releases_url":"https://api.github.com/repos/RIOT-OS/RIOT/releases{/id}","created_at":"2012-12-29T20:38:40Z","updated_at":"2015-02-28T10:08:12Z","pushed_at":"2015-02-28T10:08:12Z","git_url":"git://github.com/RIOT-OS/RIOT.git","ssh_url":"git@github.com:RIOT-OS/RIOT.git","clone_url":"https://github.com/RIOT-OS/RIOT.git","svn_url":"https://github.com/RIOT-OS/RIOT","homepage":"https://github.com/RIOT-OS/RIOT/wiki","size":84911,"stargazers_count":267,"watchers_count":267,"language":"C","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":215,"mirror_url":null,"open_issues_count":282,"forks":215,"open_issues":282,"watchers":267,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/RIOT-OS/RIOT/pulls/2503"},"html":{"href":"https://github.com/RIOT-OS/RIOT/pull/2503"},"issue":{"href":"https://api.github.com/repos/RIOT-OS/RIOT/issues/2503"},"comments":{"href":"https://api.github.com/repos/RIOT-OS/RIOT/issues/2503/comments"},"review_comments":{"href":"https://api.github.com/repos/RIOT-OS/RIOT/pulls/2503/comments"},"review_comment":{"href":"https://api.github.com/repos/RIOT-OS/RIOT/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/RIOT-OS/RIOT/pulls/2503/commits"},"statuses":{"href":"https://api.github.com/repos/RIOT-OS/RIOT/statuses/73bbed432cdaff0ef1516e86cb10e0d36f17bab1"}}}}