{"action":"created","comment":{"url":"https://api.github.com/repos/KiiPlatform/thing-if-JSSDK/pulls/comments/111295990","pull_request_review_id":32531336,"id":111295990,"diff_hunk":"@@ -0,0 +1,100 @@\n+let winston: any = require('winston');\n+\n+/**\n+ * Represents log level.\n+  <ul>\n+  <li>LogLevel.Error: error level.</li>\n+  <li>LogLevel.Warn: warn level. </li>\n+  <li>LogLevel.Info: info level.</li>\n+  <li>LogLevel.Verbose: verbose level.</li>\n+  <li>LogLevel.Debug: debug level.</li>\n+  <li>LogLevel.Silly: silly level.</li>\n+  </ul>\n+ */\n+export const LogLevel = {\n+    Error: \"error\",\n+    Warn: \"warn\",\n+    Info: \"info\",\n+    Verbose: \"verbose\",\n+    Debug: \"debug\",\n+    Silly: \"silly\"\n+}\n+\n+/**\n+ * Represents Logger for SDK.\n+ */\n+export class Logger {\n+    private static instance: Logger;\n+    private winstonLogger: any;\n+\n+    private constructor() {\n+        this.winstonLogger = new winston.Logger({\n+            level: \"error\",\n+            transports: [\n+                new (winston.transports.Console)()\n+            ]\n+        })\n+    }\n+\n+    /**\n+     * Get a singleton Logger instance.\n+     * @return {Logger} returns singleton instance of Logger.\n+     * @example\n+     * // should set log level first\n+     * ThingIF.Logger.getInstance().setLogLevel(ThingIF.LogLevel.Debug);\n+     */\n+    static getInstance(): Logger {\n+        if(!Logger.instance) {\n+            Logger.instance = new Logger();\n+        }\n+        return Logger.instance;\n+    }\n+\n+    /**\n+     * Set level of logger.\n+     * @param {string} level level should be one of values of const {@link LogLevel}.\n+     */\n+    setLogLevel(level: string) {\n+        this.winstonLogger.level = level;\n+    }\n+\n+    /**\n+     * Make a log record.\n+     * @param {string} level level should be one of values of const {@link LogLevel}.\n+     * @param {string} msg log message.\n+     */\n+    log(level: string, msg: string) {","path":"src/Logger.ts","position":null,"original_position":66,"commit_id":"86afb67d0f80d69ef6b429eb198aada18e737445","original_commit_id":"b9902cf8d3473362ac14e2c688211bc38f12caa8","user":{"login":"yongpingchen","id":1248696,"avatar_url":"https://avatars2.githubusercontent.com/u/1248696?v=3","gravatar_id":"","url":"https://api.github.com/users/yongpingchen","html_url":"https://github.com/yongpingchen","followers_url":"https://api.github.com/users/yongpingchen/followers","following_url":"https://api.github.com/users/yongpingchen/following{/other_user}","gists_url":"https://api.github.com/users/yongpingchen/gists{/gist_id}","starred_url":"https://api.github.com/users/yongpingchen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yongpingchen/subscriptions","organizations_url":"https://api.github.com/users/yongpingchen/orgs","repos_url":"https://api.github.com/users/yongpingchen/repos","events_url":"https://api.github.com/users/yongpingchen/events{/privacy}","received_events_url":"https://api.github.com/users/yongpingchen/received_events","type":"User","site_admin":false},"body":"@nfukuzaki Added support string-interpolation in commit f73f67f . ","created_at":"2017-04-13T01:39:23Z","updated_at":"2017-04-13T01:39:23Z","html_url":"https://github.com/KiiPlatform/thing-if-JSSDK/pull/197#discussion_r111295990","pull_request_url":"https://api.github.com/repos/KiiPlatform/thing-if-JSSDK/pulls/197","_links":{"self":{"href":"https://api.github.com/repos/KiiPlatform/thing-if-JSSDK/pulls/comments/111295990"},"html":{"href":"https://github.com/KiiPlatform/thing-if-JSSDK/pull/197#discussion_r111295990"},"pull_request":{"href":"https://api.github.com/repos/KiiPlatform/thing-if-JSSDK/pulls/197"}}},"pull_request":{"url":"https://api.github.com/repos/KiiPlatform/thing-if-JSSDK/pulls/197","id":115063237,"html_url":"https://github.com/KiiPlatform/thing-if-JSSDK/pull/197","diff_url":"https://github.com/KiiPlatform/thing-if-JSSDK/pull/197.diff","patch_url":"https://github.com/KiiPlatform/thing-if-JSSDK/pull/197.patch","issue_url":"https://api.github.com/repos/KiiPlatform/thing-if-JSSDK/issues/197","number":197,"state":"open","locked":false,"title":"Add logger","user":{"login":"yongpingchen","id":1248696,"avatar_url":"https://avatars2.githubusercontent.com/u/1248696?v=3","gravatar_id":"","url":"https://api.github.com/users/yongpingchen","html_url":"https://github.com/yongpingchen","followers_url":"https://api.github.com/users/yongpingchen/followers","following_url":"https://api.github.com/users/yongpingchen/following{/other_user}","gists_url":"https://api.github.com/users/yongpingchen/gists{/gist_id}","starred_url":"https://api.github.com/users/yongpingchen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yongpingchen/subscriptions","organizations_url":"https://api.github.com/users/yongpingchen/orgs","repos_url":"https://api.github.com/users/yongpingchen/repos","events_url":"https://api.github.com/users/yongpingchen/events{/privacy}","received_events_url":"https://api.github.com/users/yongpingchen/received_events","type":"User","site_admin":false},"body":"#98 \r\n### Main changes\r\n- Add Logger, use winston as tool(choose it based on the compare of [this blog](https://npmcompare.com/compare/bunyan,log4js,winston))\r\n- Log http request in debug level (in Request.ts)\r\n\r\n\r\n","created_at":"2017-04-10T09:50:00Z","updated_at":"2017-04-13T01:39:23Z","closed_at":null,"merged_at":null,"merge_commit_sha":"99cbc53df31f6e9bec4456e262c6ca5a0e576977","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/KiiPlatform/thing-if-JSSDK/pulls/197/commits","review_comments_url":"https://api.github.com/repos/KiiPlatform/thing-if-JSSDK/pulls/197/comments","review_comment_url":"https://api.github.com/repos/KiiPlatform/thing-if-JSSDK/pulls/comments{/number}","comments_url":"https://api.github.com/repos/KiiPlatform/thing-if-JSSDK/issues/197/comments","statuses_url":"https://api.github.com/repos/KiiPlatform/thing-if-JSSDK/statuses/86afb67d0f80d69ef6b429eb198aada18e737445","head":{"label":"KiiPlatform:add_logger","ref":"add_logger","sha":"86afb67d0f80d69ef6b429eb198aada18e737445","user":{"login":"KiiPlatform","id":3078752,"avatar_url":"https://avatars0.githubusercontent.com/u/3078752?v=3","gravatar_id":"","url":"https://api.github.com/users/KiiPlatform","html_url":"https://github.com/KiiPlatform","followers_url":"https://api.github.com/users/KiiPlatform/followers","following_url":"https://api.github.com/users/KiiPlatform/following{/other_user}","gists_url":"https://api.github.com/users/KiiPlatform/gists{/gist_id}","starred_url":"https://api.github.com/users/KiiPlatform/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/KiiPlatform/subscriptions","organizations_url":"https://api.github.com/users/KiiPlatform/orgs","repos_url":"https://api.github.com/users/KiiPlatform/repos","events_url":"https://api.github.com/users/KiiPlatform/events{/privacy}","received_events_url":"https://api.github.com/users/KiiPlatform/received_events","type":"Organization","site_admin":false},"repo":{"id":61766435,"name":"thing-if-JSSDK","full_name":"KiiPlatform/thing-if-JSSDK","owner":{"login":"KiiPlatform","id":3078752,"avatar_url":"https://avatars0.githubusercontent.com/u/3078752?v=3","gravatar_id":"","url":"https://api.github.com/users/KiiPlatform","html_url":"https://github.com/KiiPlatform","followers_url":"https://api.github.com/users/KiiPlatform/followers","following_url":"https://api.github.com/users/KiiPlatform/following{/other_user}","gists_url":"https://api.github.com/users/KiiPlatform/gists{/gist_id}","starred_url":"https://api.github.com/users/KiiPlatform/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/KiiPlatform/subscriptions","organizations_url":"https://api.github.com/users/KiiPlatform/orgs","repos_url":"https://api.github.com/users/KiiPlatform/repos","events_url":"https://api.github.com/users/KiiPlatform/events{/privacy}","received_events_url":"https://api.github.com/users/KiiPlatform/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/KiiPlatform/thing-if-JSSDK","description":null,"fork":false,"url":"https://api.github.com/repos/KiiPlatform/thing-if-JSSDK","forks_url":"https://api.github.com/repos/KiiPlatform/thing-if-JSSDK/forks","keys_url":"https://api.github.com/repos/KiiPlatform/thing-if-JSSDK/keys{/key_id}","collaborators_url":"https://api.github.com/repos/KiiPlatform/thing-if-JSSDK/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/KiiPlatform/thing-if-JSSDK/teams","hooks_url":"https://api.github.com/repos/KiiPlatform/thing-if-JSSDK/hooks","issue_events_url":"https://api.github.com/repos/KiiPlatform/thing-if-JSSDK/issues/events{/number}","events_url":"https://api.github.com/repos/KiiPlatform/thing-if-JSSDK/events","assignees_url":"https://api.github.com/repos/KiiPlatform/thing-if-JSSDK/assignees{/user}","branches_url":"https://api.github.com/repos/KiiPlatform/thing-if-JSSDK/branches{/branch}","tags_url":"https://api.github.com/repos/KiiPlatform/thing-if-JSSDK/tags","blobs_url":"https://api.github.com/repos/KiiPlatform/thing-if-JSSDK/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/KiiPlatform/thing-if-JSSDK/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/KiiPlatform/thing-if-JSSDK/git/refs{/sha}","trees_url":"https://api.github.com/repos/KiiPlatform/thing-if-JSSDK/git/trees{/sha}","statuses_url":"https://api.github.com/repos/KiiPlatform/thing-if-JSSDK/statuses/{sha}","languages_url":"https://api.github.com/repos/KiiPlatform/thing-if-JSSDK/languages","stargazers_url":"https://api.github.com/repos/KiiPlatform/thing-if-JSSDK/stargazers","contributors_url":"https://api.github.com/repos/KiiPlatform/thing-if-JSSDK/contributors","subscribers_url":"https://api.github.com/repos/KiiPlatform/thing-if-JSSDK/subscribers","subscription_url":"https://api.github.com/repos/KiiPlatform/thing-if-JSSDK/subscription","commits_url":"https://api.github.com/repos/KiiPlatform/thing-if-JSSDK/commits{/sha}","git_commits_url":"https://api.github.com/repos/KiiPlatform/thing-if-JSSDK/git/commits{/sha}","comments_url":"https://api.github.com/repos/KiiPlatform/thing-if-JSSDK/comments{/number}","issue_comment_url":"https://api.github.com/repos/KiiPlatform/thing-if-JSSDK/issues/comments{/number}","contents_url":"https://api.github.com/repos/KiiPlatform/thing-if-JSSDK/contents/{+path}","compare_url":"https://api.github.com/repos/KiiPlatform/thing-if-JSSDK/compare/{base}...{head}","merges_url":"https://api.github.com/repos/KiiPlatform/thing-if-JSSDK/merges","archive_url":"https://api.github.com/repos/KiiPlatform/thing-if-JSSDK/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/KiiPlatform/thing-if-JSSDK/downloads","issues_url":"https://api.github.com/repos/KiiPlatform/thing-if-JSSDK/issues{/number}","pulls_url":"https://api.github.com/repos/KiiPlatform/thing-if-JSSDK/pulls{/number}","milestones_url":"https://api.github.com/repos/KiiPlatform/thing-if-JSSDK/milestones{/number}","notifications_url":"https://api.github.com/repos/KiiPlatform/thing-if-JSSDK/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/KiiPlatform/thing-if-JSSDK/labels{/name}","releases_url":"https://api.github.com/repos/KiiPlatform/thing-if-JSSDK/releases{/id}","deployments_url":"https://api.github.com/repos/KiiPlatform/thing-if-JSSDK/deployments","created_at":"2016-06-23T02:23:23Z","updated_at":"2016-11-11T03:26:28Z","pushed_at":"2017-04-13T01:37:45Z","git_url":"git://github.com/KiiPlatform/thing-if-JSSDK.git","ssh_url":"git@github.com:KiiPlatform/thing-if-JSSDK.git","clone_url":"https://github.com/KiiPlatform/thing-if-JSSDK.git","svn_url":"https://github.com/KiiPlatform/thing-if-JSSDK","homepage":"https://kiiplatform.github.io/thing-if-JSSDK/","size":1110,"stargazers_count":4,"watchers_count":4,"language":"TypeScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":3,"forks":0,"open_issues":3,"watchers":4,"default_branch":"develop"}},"base":{"label":"KiiPlatform:develop","ref":"develop","sha":"b87d646cade87c7457d71d80dc9174889b0b0a86","user":{"login":"KiiPlatform","id":3078752,"avatar_url":"https://avatars0.githubusercontent.com/u/3078752?v=3","gravatar_id":"","url":"https://api.github.com/users/KiiPlatform","html_url":"https://github.com/KiiPlatform","followers_url":"https://api.github.com/users/KiiPlatform/followers","following_url":"https://api.github.com/users/KiiPlatform/following{/other_user}","gists_url":"https://api.github.com/users/KiiPlatform/gists{/gist_id}","starred_url":"https://api.github.com/users/KiiPlatform/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/KiiPlatform/subscriptions","organizations_url":"https://api.github.com/users/KiiPlatform/orgs","repos_url":"https://api.github.com/users/KiiPlatform/repos","events_url":"https://api.github.com/users/KiiPlatform/events{/privacy}","received_events_url":"https://api.github.com/users/KiiPlatform/received_events","type":"Organization","site_admin":false},"repo":{"id":61766435,"name":"thing-if-JSSDK","full_name":"KiiPlatform/thing-if-JSSDK","owner":{"login":"KiiPlatform","id":3078752,"avatar_url":"https://avatars0.githubusercontent.com/u/3078752?v=3","gravatar_id":"","url":"https://api.github.com/users/KiiPlatform","html_url":"https://github.com/KiiPlatform","followers_url":"https://api.github.com/users/KiiPlatform/followers","following_url":"https://api.github.com/users/KiiPlatform/following{/other_user}","gists_url":"https://api.github.com/users/KiiPlatform/gists{/gist_id}","starred_url":"https://api.github.com/users/KiiPlatform/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/KiiPlatform/subscriptions","organizations_url":"https://api.github.com/users/KiiPlatform/orgs","repos_url":"https://api.github.com/users/KiiPlatform/repos","events_url":"https://api.github.com/users/KiiPlatform/events{/privacy}","received_events_url":"https://api.github.com/users/KiiPlatform/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/KiiPlatform/thing-if-JSSDK","description":null,"fork":false,"url":"https://api.github.com/repos/KiiPlatform/thing-if-JSSDK","forks_url":"https://api.github.com/repos/KiiPlatform/thing-if-JSSDK/forks","keys_url":"https://api.github.com/repos/KiiPlatform/thing-if-JSSDK/keys{/key_id}","collaborators_url":"https://api.github.com/repos/KiiPlatform/thing-if-JSSDK/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/KiiPlatform/thing-if-JSSDK/teams","hooks_url":"https://api.github.com/repos/KiiPlatform/thing-if-JSSDK/hooks","issue_events_url":"https://api.github.com/repos/KiiPlatform/thing-if-JSSDK/issues/events{/number}","events_url":"https://api.github.com/repos/KiiPlatform/thing-if-JSSDK/events","assignees_url":"https://api.github.com/repos/KiiPlatform/thing-if-JSSDK/assignees{/user}","branches_url":"https://api.github.com/repos/KiiPlatform/thing-if-JSSDK/branches{/branch}","tags_url":"https://api.github.com/repos/KiiPlatform/thing-if-JSSDK/tags","blobs_url":"https://api.github.com/repos/KiiPlatform/thing-if-JSSDK/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/KiiPlatform/thing-if-JSSDK/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/KiiPlatform/thing-if-JSSDK/git/refs{/sha}","trees_url":"https://api.github.com/repos/KiiPlatform/thing-if-JSSDK/git/trees{/sha}","statuses_url":"https://api.github.com/repos/KiiPlatform/thing-if-JSSDK/statuses/{sha}","languages_url":"https://api.github.com/repos/KiiPlatform/thing-if-JSSDK/languages","stargazers_url":"https://api.github.com/repos/KiiPlatform/thing-if-JSSDK/stargazers","contributors_url":"https://api.github.com/repos/KiiPlatform/thing-if-JSSDK/contributors","subscribers_url":"https://api.github.com/repos/KiiPlatform/thing-if-JSSDK/subscribers","subscription_url":"https://api.github.com/repos/KiiPlatform/thing-if-JSSDK/subscription","commits_url":"https://api.github.com/repos/KiiPlatform/thing-if-JSSDK/commits{/sha}","git_commits_url":"https://api.github.com/repos/KiiPlatform/thing-if-JSSDK/git/commits{/sha}","comments_url":"https://api.github.com/repos/KiiPlatform/thing-if-JSSDK/comments{/number}","issue_comment_url":"https://api.github.com/repos/KiiPlatform/thing-if-JSSDK/issues/comments{/number}","contents_url":"https://api.github.com/repos/KiiPlatform/thing-if-JSSDK/contents/{+path}","compare_url":"https://api.github.com/repos/KiiPlatform/thing-if-JSSDK/compare/{base}...{head}","merges_url":"https://api.github.com/repos/KiiPlatform/thing-if-JSSDK/merges","archive_url":"https://api.github.com/repos/KiiPlatform/thing-if-JSSDK/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/KiiPlatform/thing-if-JSSDK/downloads","issues_url":"https://api.github.com/repos/KiiPlatform/thing-if-JSSDK/issues{/number}","pulls_url":"https://api.github.com/repos/KiiPlatform/thing-if-JSSDK/pulls{/number}","milestones_url":"https://api.github.com/repos/KiiPlatform/thing-if-JSSDK/milestones{/number}","notifications_url":"https://api.github.com/repos/KiiPlatform/thing-if-JSSDK/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/KiiPlatform/thing-if-JSSDK/labels{/name}","releases_url":"https://api.github.com/repos/KiiPlatform/thing-if-JSSDK/releases{/id}","deployments_url":"https://api.github.com/repos/KiiPlatform/thing-if-JSSDK/deployments","created_at":"2016-06-23T02:23:23Z","updated_at":"2016-11-11T03:26:28Z","pushed_at":"2017-04-13T01:37:45Z","git_url":"git://github.com/KiiPlatform/thing-if-JSSDK.git","ssh_url":"git@github.com:KiiPlatform/thing-if-JSSDK.git","clone_url":"https://github.com/KiiPlatform/thing-if-JSSDK.git","svn_url":"https://github.com/KiiPlatform/thing-if-JSSDK","homepage":"https://kiiplatform.github.io/thing-if-JSSDK/","size":1110,"stargazers_count":4,"watchers_count":4,"language":"TypeScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":3,"forks":0,"open_issues":3,"watchers":4,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/KiiPlatform/thing-if-JSSDK/pulls/197"},"html":{"href":"https://github.com/KiiPlatform/thing-if-JSSDK/pull/197"},"issue":{"href":"https://api.github.com/repos/KiiPlatform/thing-if-JSSDK/issues/197"},"comments":{"href":"https://api.github.com/repos/KiiPlatform/thing-if-JSSDK/issues/197/comments"},"review_comments":{"href":"https://api.github.com/repos/KiiPlatform/thing-if-JSSDK/pulls/197/comments"},"review_comment":{"href":"https://api.github.com/repos/KiiPlatform/thing-if-JSSDK/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/KiiPlatform/thing-if-JSSDK/pulls/197/commits"},"statuses":{"href":"https://api.github.com/repos/KiiPlatform/thing-if-JSSDK/statuses/86afb67d0f80d69ef6b429eb198aada18e737445"}}}}
{"actor":{"display_login":"yongpingchen"}}