{"action":"created","comment":{"url":"https://api.github.com/repos/puppetlabs/leatherman/pulls/comments/40927000","id":40927000,"diff_hunk":"@@ -81,15 +107,61 @@ namespace leatherman { namespace logging {\n         dst.imbue(leatherman::locale::get_locale(locale));\n #endif\n \n-        boost::log::add_common_attributes();\n-\n-        // Default to the warning level\n-        set_level(log_level::warning);\n+        setup_common_logging_config<sink_t>(sink);\n \n         // Set whether or not to use colorization depending if the destination is a tty\n         g_colorize = color_supported(dst);\n     }\n \n+    void setup_logging(std::string file_name,\n+                       std::ios_base::openmode open_mode,\n+                       std::string target,\n+                       int rotation_size,\n+                       int max_size,\n+                       int min_free_space,\n+                       std::string locale)\n+    {\n+        // Initialize locale to default before boost::log in order to avoid\n+        // crashes during process termination due to file sinks; refer to\n+        // www.boost.org/doc/libs/1_59_0/libs/log/doc/html/log/rationale/why_crash_on_term.html\n+        boost::filesystem::path::imbue(std::locale(\"C\"));","path":"logging/src/logging.cc","position":128,"original_position":128,"commit_id":"eef292891da031c3ababe60bd097f361c680891c","original_commit_id":"eef292891da031c3ababe60bd097f361c680891c","user":{"login":"parisiale","id":7150922,"avatar_url":"https://avatars.githubusercontent.com/u/7150922?v=3","gravatar_id":"","url":"https://api.github.com/users/parisiale","html_url":"https://github.com/parisiale","followers_url":"https://api.github.com/users/parisiale/followers","following_url":"https://api.github.com/users/parisiale/following{/other_user}","gists_url":"https://api.github.com/users/parisiale/gists{/gist_id}","starred_url":"https://api.github.com/users/parisiale/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/parisiale/subscriptions","organizations_url":"https://api.github.com/users/parisiale/orgs","repos_url":"https://api.github.com/users/parisiale/repos","events_url":"https://api.github.com/users/parisiale/events{/privacy}","received_events_url":"https://api.github.com/users/parisiale/received_events","type":"User","site_admin":false},"body":"@branan please check this.","created_at":"2015-10-01T15:29:17Z","updated_at":"2015-10-01T15:29:17Z","html_url":"https://github.com/puppetlabs/leatherman/pull/88#discussion_r40927000","pull_request_url":"https://api.github.com/repos/puppetlabs/leatherman/pulls/88","_links":{"self":{"href":"https://api.github.com/repos/puppetlabs/leatherman/pulls/comments/40927000"},"html":{"href":"https://github.com/puppetlabs/leatherman/pull/88#discussion_r40927000"},"pull_request":{"href":"https://api.github.com/repos/puppetlabs/leatherman/pulls/88"}}},"pull_request":{"url":"https://api.github.com/repos/puppetlabs/leatherman/pulls/88","id":46270077,"html_url":"https://github.com/puppetlabs/leatherman/pull/88","diff_url":"https://github.com/puppetlabs/leatherman/pull/88.diff","patch_url":"https://github.com/puppetlabs/leatherman/pull/88.patch","issue_url":"https://api.github.com/repos/puppetlabs/leatherman/issues/88","number":88,"state":"open","locked":false,"title":"(CTH-378) Rotate log files","user":{"login":"parisiale","id":7150922,"avatar_url":"https://avatars.githubusercontent.com/u/7150922?v=3","gravatar_id":"","url":"https://api.github.com/users/parisiale","html_url":"https://github.com/parisiale","followers_url":"https://api.github.com/users/parisiale/followers","following_url":"https://api.github.com/users/parisiale/following{/other_user}","gists_url":"https://api.github.com/users/parisiale/gists{/gist_id}","starred_url":"https://api.github.com/users/parisiale/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/parisiale/subscriptions","organizations_url":"https://api.github.com/users/parisiale/orgs","repos_url":"https://api.github.com/users/parisiale/repos","events_url":"https://api.github.com/users/parisiale/events{/privacy}","received_events_url":"https://api.github.com/users/parisiale/received_events","type":"User","site_admin":false},"body":"Enable log file rotation by using the text_file_backend as the backend\r\nsink of boost log. Log file rotation will be performed by file size.","created_at":"2015-09-29T12:25:36Z","updated_at":"2015-10-01T15:29:17Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a498812a142fd918a29769374b9dd881a98aca09","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/puppetlabs/leatherman/pulls/88/commits","review_comments_url":"https://api.github.com/repos/puppetlabs/leatherman/pulls/88/comments","review_comment_url":"https://api.github.com/repos/puppetlabs/leatherman/pulls/comments{/number}","comments_url":"https://api.github.com/repos/puppetlabs/leatherman/issues/88/comments","statuses_url":"https://api.github.com/repos/puppetlabs/leatherman/statuses/eef292891da031c3ababe60bd097f361c680891c","head":{"label":"parisiale:CTH-378","ref":"CTH-378","sha":"eef292891da031c3ababe60bd097f361c680891c","user":{"login":"parisiale","id":7150922,"avatar_url":"https://avatars.githubusercontent.com/u/7150922?v=3","gravatar_id":"","url":"https://api.github.com/users/parisiale","html_url":"https://github.com/parisiale","followers_url":"https://api.github.com/users/parisiale/followers","following_url":"https://api.github.com/users/parisiale/following{/other_user}","gists_url":"https://api.github.com/users/parisiale/gists{/gist_id}","starred_url":"https://api.github.com/users/parisiale/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/parisiale/subscriptions","organizations_url":"https://api.github.com/users/parisiale/orgs","repos_url":"https://api.github.com/users/parisiale/repos","events_url":"https://api.github.com/users/parisiale/events{/privacy}","received_events_url":"https://api.github.com/users/parisiale/received_events","type":"User","site_admin":false},"repo":{"id":32394531,"name":"leatherman","full_name":"parisiale/leatherman","owner":{"login":"parisiale","id":7150922,"avatar_url":"https://avatars.githubusercontent.com/u/7150922?v=3","gravatar_id":"","url":"https://api.github.com/users/parisiale","html_url":"https://github.com/parisiale","followers_url":"https://api.github.com/users/parisiale/followers","following_url":"https://api.github.com/users/parisiale/following{/other_user}","gists_url":"https://api.github.com/users/parisiale/gists{/gist_id}","starred_url":"https://api.github.com/users/parisiale/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/parisiale/subscriptions","organizations_url":"https://api.github.com/users/parisiale/orgs","repos_url":"https://api.github.com/users/parisiale/repos","events_url":"https://api.github.com/users/parisiale/events{/privacy}","received_events_url":"https://api.github.com/users/parisiale/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/parisiale/leatherman","description":"A collection of C++ and CMake utility libraries.","fork":true,"url":"https://api.github.com/repos/parisiale/leatherman","forks_url":"https://api.github.com/repos/parisiale/leatherman/forks","keys_url":"https://api.github.com/repos/parisiale/leatherman/keys{/key_id}","collaborators_url":"https://api.github.com/repos/parisiale/leatherman/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/parisiale/leatherman/teams","hooks_url":"https://api.github.com/repos/parisiale/leatherman/hooks","issue_events_url":"https://api.github.com/repos/parisiale/leatherman/issues/events{/number}","events_url":"https://api.github.com/repos/parisiale/leatherman/events","assignees_url":"https://api.github.com/repos/parisiale/leatherman/assignees{/user}","branches_url":"https://api.github.com/repos/parisiale/leatherman/branches{/branch}","tags_url":"https://api.github.com/repos/parisiale/leatherman/tags","blobs_url":"https://api.github.com/repos/parisiale/leatherman/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/parisiale/leatherman/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/parisiale/leatherman/git/refs{/sha}","trees_url":"https://api.github.com/repos/parisiale/leatherman/git/trees{/sha}","statuses_url":"https://api.github.com/repos/parisiale/leatherman/statuses/{sha}","languages_url":"https://api.github.com/repos/parisiale/leatherman/languages","stargazers_url":"https://api.github.com/repos/parisiale/leatherman/stargazers","contributors_url":"https://api.github.com/repos/parisiale/leatherman/contributors","subscribers_url":"https://api.github.com/repos/parisiale/leatherman/subscribers","subscription_url":"https://api.github.com/repos/parisiale/leatherman/subscription","commits_url":"https://api.github.com/repos/parisiale/leatherman/commits{/sha}","git_commits_url":"https://api.github.com/repos/parisiale/leatherman/git/commits{/sha}","comments_url":"https://api.github.com/repos/parisiale/leatherman/comments{/number}","issue_comment_url":"https://api.github.com/repos/parisiale/leatherman/issues/comments{/number}","contents_url":"https://api.github.com/repos/parisiale/leatherman/contents/{+path}","compare_url":"https://api.github.com/repos/parisiale/leatherman/compare/{base}...{head}","merges_url":"https://api.github.com/repos/parisiale/leatherman/merges","archive_url":"https://api.github.com/repos/parisiale/leatherman/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/parisiale/leatherman/downloads","issues_url":"https://api.github.com/repos/parisiale/leatherman/issues{/number}","pulls_url":"https://api.github.com/repos/parisiale/leatherman/pulls{/number}","milestones_url":"https://api.github.com/repos/parisiale/leatherman/milestones{/number}","notifications_url":"https://api.github.com/repos/parisiale/leatherman/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/parisiale/leatherman/labels{/name}","releases_url":"https://api.github.com/repos/parisiale/leatherman/releases{/id}","created_at":"2015-03-17T13:20:11Z","updated_at":"2015-03-17T13:20:11Z","pushed_at":"2015-10-01T15:27:53Z","git_url":"git://github.com/parisiale/leatherman.git","ssh_url":"git@github.com:parisiale/leatherman.git","clone_url":"https://github.com/parisiale/leatherman.git","svn_url":"https://github.com/parisiale/leatherman","homepage":"","size":694,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"puppetlabs:master","ref":"master","sha":"f1ebcfd956a93d47d488dbc952121d758d4bdc5e","user":{"login":"puppetlabs","id":234268,"avatar_url":"https://avatars.githubusercontent.com/u/234268?v=3","gravatar_id":"","url":"https://api.github.com/users/puppetlabs","html_url":"https://github.com/puppetlabs","followers_url":"https://api.github.com/users/puppetlabs/followers","following_url":"https://api.github.com/users/puppetlabs/following{/other_user}","gists_url":"https://api.github.com/users/puppetlabs/gists{/gist_id}","starred_url":"https://api.github.com/users/puppetlabs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/puppetlabs/subscriptions","organizations_url":"https://api.github.com/users/puppetlabs/orgs","repos_url":"https://api.github.com/users/puppetlabs/repos","events_url":"https://api.github.com/users/puppetlabs/events{/privacy}","received_events_url":"https://api.github.com/users/puppetlabs/received_events","type":"Organization","site_admin":false},"repo":{"id":31226286,"name":"leatherman","full_name":"puppetlabs/leatherman","owner":{"login":"puppetlabs","id":234268,"avatar_url":"https://avatars.githubusercontent.com/u/234268?v=3","gravatar_id":"","url":"https://api.github.com/users/puppetlabs","html_url":"https://github.com/puppetlabs","followers_url":"https://api.github.com/users/puppetlabs/followers","following_url":"https://api.github.com/users/puppetlabs/following{/other_user}","gists_url":"https://api.github.com/users/puppetlabs/gists{/gist_id}","starred_url":"https://api.github.com/users/puppetlabs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/puppetlabs/subscriptions","organizations_url":"https://api.github.com/users/puppetlabs/orgs","repos_url":"https://api.github.com/users/puppetlabs/repos","events_url":"https://api.github.com/users/puppetlabs/events{/privacy}","received_events_url":"https://api.github.com/users/puppetlabs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/puppetlabs/leatherman","description":"A collection of C++ and CMake utility libraries.","fork":false,"url":"https://api.github.com/repos/puppetlabs/leatherman","forks_url":"https://api.github.com/repos/puppetlabs/leatherman/forks","keys_url":"https://api.github.com/repos/puppetlabs/leatherman/keys{/key_id}","collaborators_url":"https://api.github.com/repos/puppetlabs/leatherman/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/puppetlabs/leatherman/teams","hooks_url":"https://api.github.com/repos/puppetlabs/leatherman/hooks","issue_events_url":"https://api.github.com/repos/puppetlabs/leatherman/issues/events{/number}","events_url":"https://api.github.com/repos/puppetlabs/leatherman/events","assignees_url":"https://api.github.com/repos/puppetlabs/leatherman/assignees{/user}","branches_url":"https://api.github.com/repos/puppetlabs/leatherman/branches{/branch}","tags_url":"https://api.github.com/repos/puppetlabs/leatherman/tags","blobs_url":"https://api.github.com/repos/puppetlabs/leatherman/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/puppetlabs/leatherman/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/puppetlabs/leatherman/git/refs{/sha}","trees_url":"https://api.github.com/repos/puppetlabs/leatherman/git/trees{/sha}","statuses_url":"https://api.github.com/repos/puppetlabs/leatherman/statuses/{sha}","languages_url":"https://api.github.com/repos/puppetlabs/leatherman/languages","stargazers_url":"https://api.github.com/repos/puppetlabs/leatherman/stargazers","contributors_url":"https://api.github.com/repos/puppetlabs/leatherman/contributors","subscribers_url":"https://api.github.com/repos/puppetlabs/leatherman/subscribers","subscription_url":"https://api.github.com/repos/puppetlabs/leatherman/subscription","commits_url":"https://api.github.com/repos/puppetlabs/leatherman/commits{/sha}","git_commits_url":"https://api.github.com/repos/puppetlabs/leatherman/git/commits{/sha}","comments_url":"https://api.github.com/repos/puppetlabs/leatherman/comments{/number}","issue_comment_url":"https://api.github.com/repos/puppetlabs/leatherman/issues/comments{/number}","contents_url":"https://api.github.com/repos/puppetlabs/leatherman/contents/{+path}","compare_url":"https://api.github.com/repos/puppetlabs/leatherman/compare/{base}...{head}","merges_url":"https://api.github.com/repos/puppetlabs/leatherman/merges","archive_url":"https://api.github.com/repos/puppetlabs/leatherman/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/puppetlabs/leatherman/downloads","issues_url":"https://api.github.com/repos/puppetlabs/leatherman/issues{/number}","pulls_url":"https://api.github.com/repos/puppetlabs/leatherman/pulls{/number}","milestones_url":"https://api.github.com/repos/puppetlabs/leatherman/milestones{/number}","notifications_url":"https://api.github.com/repos/puppetlabs/leatherman/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/puppetlabs/leatherman/labels{/name}","releases_url":"https://api.github.com/repos/puppetlabs/leatherman/releases{/id}","created_at":"2015-02-23T19:50:46Z","updated_at":"2015-08-27T13:17:42Z","pushed_at":"2015-10-01T15:27:54Z","git_url":"git://github.com/puppetlabs/leatherman.git","ssh_url":"git@github.com:puppetlabs/leatherman.git","clone_url":"https://github.com/puppetlabs/leatherman.git","svn_url":"https://github.com/puppetlabs/leatherman","homepage":"","size":1446,"stargazers_count":1,"watchers_count":1,"language":"C++","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":15,"mirror_url":null,"open_issues_count":3,"forks":15,"open_issues":3,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/puppetlabs/leatherman/pulls/88"},"html":{"href":"https://github.com/puppetlabs/leatherman/pull/88"},"issue":{"href":"https://api.github.com/repos/puppetlabs/leatherman/issues/88"},"comments":{"href":"https://api.github.com/repos/puppetlabs/leatherman/issues/88/comments"},"review_comments":{"href":"https://api.github.com/repos/puppetlabs/leatherman/pulls/88/comments"},"review_comment":{"href":"https://api.github.com/repos/puppetlabs/leatherman/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/puppetlabs/leatherman/pulls/88/commits"},"statuses":{"href":"https://api.github.com/repos/puppetlabs/leatherman/statuses/eef292891da031c3ababe60bd097f361c680891c"}}}}