{"action":"closed","number":66,"pull_request":{"url":"https://api.github.com/repos/sebasmagri/env_logger/pulls/66","id":168967157,"html_url":"https://github.com/sebasmagri/env_logger/pull/66","diff_url":"https://github.com/sebasmagri/env_logger/pull/66.diff","patch_url":"https://github.com/sebasmagri/env_logger/pull/66.patch","issue_url":"https://api.github.com/repos/sebasmagri/env_logger/issues/66","number":66,"state":"closed","locked":false,"title":"Allow toggling parts of the default format","user":{"login":"KodrAus","id":6721458,"avatar_url":"https://avatars0.githubusercontent.com/u/6721458?v=4","gravatar_id":"","url":"https://api.github.com/users/KodrAus","html_url":"https://github.com/KodrAus","followers_url":"https://api.github.com/users/KodrAus/followers","following_url":"https://api.github.com/users/KodrAus/following{/other_user}","gists_url":"https://api.github.com/users/KodrAus/gists{/gist_id}","starred_url":"https://api.github.com/users/KodrAus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/KodrAus/subscriptions","organizations_url":"https://api.github.com/users/KodrAus/orgs","repos_url":"https://api.github.com/users/KodrAus/repos","events_url":"https://api.github.com/users/KodrAus/events{/privacy}","received_events_url":"https://api.github.com/users/KodrAus/received_events","type":"User","site_admin":false},"body":"closes #48 \r\n\r\n# `default_format` methods\r\n\r\nThis PR tweaks the default format a bit so we can conditionally enable/disable parts of it in the main `Builder`. The API looks like:\r\n\r\n```rust\r\nimpl Builder {\r\n    fn default_format(&mut self) -> &mut Self;\r\n    fn default_format_timestamp(&mut self, write: bool) -> &mut Self;\r\n    fn default_format_module_path(&mut self, write: bool) -> &mut Self;\r\n    fn default_format_level(&mut self, write: bool) -> &mut Self;\r\n}\r\n```\r\n\r\nThis isn't the most elegant API, but I think it solves the problem of conveniently tweaking the default format without needing to import types or figure out the custom formatting API. We could bikeshed the naming (maybe `use_default_format` and `write_default_format_timestamp`?)\r\n\r\nCalling `default_format_*` will store whether or not we want to include those parts of the log, without affecting a custom format. That means:\r\n\r\n```rust\r\nBuilder::new()\r\n    .format(|buf, record| { ... })\r\n    .default_format_timestamp(false)\r\n    .init();\r\n```\r\n\r\nIs the same as:\r\n\r\n```rust\r\nBuilder::new()\r\n    .format(|buf, record| { ... })\r\n    .init();\r\n```\r\n\r\nSetting a custom format won't clobber any values passed to `default_format_*` methods. That means:\r\n\r\n```rust\r\nBuilder::new()\r\n    .default_format_timestamp(false)\r\n    .format(|buf, record| { ... })\r\n    .default_format()\r\n    .init();\r\n```\r\n\r\nIs the same as:\r\n\r\n```rust\r\nBuilder::new()\r\n    .default_format_timestamp(false)\r\n    .init();\r\n```\r\n\r\nI'm not expecting users to hop between custom and default formats, but I thought these were the least surprising semantics.\r\n\r\nThe docs need fleshing out.\r\n\r\n# `from_default_env`\r\n\r\nThis PR also adds a new `from_default_env` method that's a convenient way of calling `from_env(env_logger::Env::default())`.","created_at":"2018-02-13T21:57:42Z","updated_at":"2018-03-09T02:03:11Z","closed_at":"2018-03-09T02:03:10Z","merged_at":"2018-03-09T02:03:10Z","merge_commit_sha":"8223adfcac6e5b1f6b1c93ec3df4d60712689ed6","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/sebasmagri/env_logger/pulls/66/commits","review_comments_url":"https://api.github.com/repos/sebasmagri/env_logger/pulls/66/comments","review_comment_url":"https://api.github.com/repos/sebasmagri/env_logger/pulls/comments{/number}","comments_url":"https://api.github.com/repos/sebasmagri/env_logger/issues/66/comments","statuses_url":"https://api.github.com/repos/sebasmagri/env_logger/statuses/b374c317f5080f991fdbb1a57ee2c1e922c4e702","head":{"label":"sebasmagri:feat/default-format-knobs","ref":"feat/default-format-knobs","sha":"b374c317f5080f991fdbb1a57ee2c1e922c4e702","user":{"login":"sebasmagri","id":11137,"avatar_url":"https://avatars1.githubusercontent.com/u/11137?v=4","gravatar_id":"","url":"https://api.github.com/users/sebasmagri","html_url":"https://github.com/sebasmagri","followers_url":"https://api.github.com/users/sebasmagri/followers","following_url":"https://api.github.com/users/sebasmagri/following{/other_user}","gists_url":"https://api.github.com/users/sebasmagri/gists{/gist_id}","starred_url":"https://api.github.com/users/sebasmagri/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sebasmagri/subscriptions","organizations_url":"https://api.github.com/users/sebasmagri/orgs","repos_url":"https://api.github.com/users/sebasmagri/repos","events_url":"https://api.github.com/users/sebasmagri/events{/privacy}","received_events_url":"https://api.github.com/users/sebasmagri/received_events","type":"User","site_admin":false},"repo":{"id":96382888,"name":"env_logger","full_name":"sebasmagri/env_logger","owner":{"login":"sebasmagri","id":11137,"avatar_url":"https://avatars1.githubusercontent.com/u/11137?v=4","gravatar_id":"","url":"https://api.github.com/users/sebasmagri","html_url":"https://github.com/sebasmagri","followers_url":"https://api.github.com/users/sebasmagri/followers","following_url":"https://api.github.com/users/sebasmagri/following{/other_user}","gists_url":"https://api.github.com/users/sebasmagri/gists{/gist_id}","starred_url":"https://api.github.com/users/sebasmagri/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sebasmagri/subscriptions","organizations_url":"https://api.github.com/users/sebasmagri/orgs","repos_url":"https://api.github.com/users/sebasmagri/repos","events_url":"https://api.github.com/users/sebasmagri/events{/privacy}","received_events_url":"https://api.github.com/users/sebasmagri/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/sebasmagri/env_logger","description":"A logging implementation for `log` which is configured via an environment variable.","fork":false,"url":"https://api.github.com/repos/sebasmagri/env_logger","forks_url":"https://api.github.com/repos/sebasmagri/env_logger/forks","keys_url":"https://api.github.com/repos/sebasmagri/env_logger/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sebasmagri/env_logger/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sebasmagri/env_logger/teams","hooks_url":"https://api.github.com/repos/sebasmagri/env_logger/hooks","issue_events_url":"https://api.github.com/repos/sebasmagri/env_logger/issues/events{/number}","events_url":"https://api.github.com/repos/sebasmagri/env_logger/events","assignees_url":"https://api.github.com/repos/sebasmagri/env_logger/assignees{/user}","branches_url":"https://api.github.com/repos/sebasmagri/env_logger/branches{/branch}","tags_url":"https://api.github.com/repos/sebasmagri/env_logger/tags","blobs_url":"https://api.github.com/repos/sebasmagri/env_logger/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sebasmagri/env_logger/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sebasmagri/env_logger/git/refs{/sha}","trees_url":"https://api.github.com/repos/sebasmagri/env_logger/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sebasmagri/env_logger/statuses/{sha}","languages_url":"https://api.github.com/repos/sebasmagri/env_logger/languages","stargazers_url":"https://api.github.com/repos/sebasmagri/env_logger/stargazers","contributors_url":"https://api.github.com/repos/sebasmagri/env_logger/contributors","subscribers_url":"https://api.github.com/repos/sebasmagri/env_logger/subscribers","subscription_url":"https://api.github.com/repos/sebasmagri/env_logger/subscription","commits_url":"https://api.github.com/repos/sebasmagri/env_logger/commits{/sha}","git_commits_url":"https://api.github.com/repos/sebasmagri/env_logger/git/commits{/sha}","comments_url":"https://api.github.com/repos/sebasmagri/env_logger/comments{/number}","issue_comment_url":"https://api.github.com/repos/sebasmagri/env_logger/issues/comments{/number}","contents_url":"https://api.github.com/repos/sebasmagri/env_logger/contents/{+path}","compare_url":"https://api.github.com/repos/sebasmagri/env_logger/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sebasmagri/env_logger/merges","archive_url":"https://api.github.com/repos/sebasmagri/env_logger/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sebasmagri/env_logger/downloads","issues_url":"https://api.github.com/repos/sebasmagri/env_logger/issues{/number}","pulls_url":"https://api.github.com/repos/sebasmagri/env_logger/pulls{/number}","milestones_url":"https://api.github.com/repos/sebasmagri/env_logger/milestones{/number}","notifications_url":"https://api.github.com/repos/sebasmagri/env_logger/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sebasmagri/env_logger/labels{/name}","releases_url":"https://api.github.com/repos/sebasmagri/env_logger/releases{/id}","deployments_url":"https://api.github.com/repos/sebasmagri/env_logger/deployments","created_at":"2017-07-06T03:07:16Z","updated_at":"2018-02-28T10:31:42Z","pushed_at":"2018-03-09T02:03:10Z","git_url":"git://github.com/sebasmagri/env_logger.git","ssh_url":"git@github.com:sebasmagri/env_logger.git","clone_url":"https://github.com/sebasmagri/env_logger.git","svn_url":"https://github.com/sebasmagri/env_logger","homepage":null,"size":145,"stargazers_count":39,"watchers_count":39,"language":"Rust","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":20,"mirror_url":null,"archived":false,"open_issues_count":8,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0"},"forks":20,"open_issues":8,"watchers":39,"default_branch":"master"}},"base":{"label":"sebasmagri:master","ref":"master","sha":"02fda0fddf884983a6dba021853c5794feeb4a87","user":{"login":"sebasmagri","id":11137,"avatar_url":"https://avatars1.githubusercontent.com/u/11137?v=4","gravatar_id":"","url":"https://api.github.com/users/sebasmagri","html_url":"https://github.com/sebasmagri","followers_url":"https://api.github.com/users/sebasmagri/followers","following_url":"https://api.github.com/users/sebasmagri/following{/other_user}","gists_url":"https://api.github.com/users/sebasmagri/gists{/gist_id}","starred_url":"https://api.github.com/users/sebasmagri/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sebasmagri/subscriptions","organizations_url":"https://api.github.com/users/sebasmagri/orgs","repos_url":"https://api.github.com/users/sebasmagri/repos","events_url":"https://api.github.com/users/sebasmagri/events{/privacy}","received_events_url":"https://api.github.com/users/sebasmagri/received_events","type":"User","site_admin":false},"repo":{"id":96382888,"name":"env_logger","full_name":"sebasmagri/env_logger","owner":{"login":"sebasmagri","id":11137,"avatar_url":"https://avatars1.githubusercontent.com/u/11137?v=4","gravatar_id":"","url":"https://api.github.com/users/sebasmagri","html_url":"https://github.com/sebasmagri","followers_url":"https://api.github.com/users/sebasmagri/followers","following_url":"https://api.github.com/users/sebasmagri/following{/other_user}","gists_url":"https://api.github.com/users/sebasmagri/gists{/gist_id}","starred_url":"https://api.github.com/users/sebasmagri/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sebasmagri/subscriptions","organizations_url":"https://api.github.com/users/sebasmagri/orgs","repos_url":"https://api.github.com/users/sebasmagri/repos","events_url":"https://api.github.com/users/sebasmagri/events{/privacy}","received_events_url":"https://api.github.com/users/sebasmagri/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/sebasmagri/env_logger","description":"A logging implementation for `log` which is configured via an environment variable.","fork":false,"url":"https://api.github.com/repos/sebasmagri/env_logger","forks_url":"https://api.github.com/repos/sebasmagri/env_logger/forks","keys_url":"https://api.github.com/repos/sebasmagri/env_logger/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sebasmagri/env_logger/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sebasmagri/env_logger/teams","hooks_url":"https://api.github.com/repos/sebasmagri/env_logger/hooks","issue_events_url":"https://api.github.com/repos/sebasmagri/env_logger/issues/events{/number}","events_url":"https://api.github.com/repos/sebasmagri/env_logger/events","assignees_url":"https://api.github.com/repos/sebasmagri/env_logger/assignees{/user}","branches_url":"https://api.github.com/repos/sebasmagri/env_logger/branches{/branch}","tags_url":"https://api.github.com/repos/sebasmagri/env_logger/tags","blobs_url":"https://api.github.com/repos/sebasmagri/env_logger/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sebasmagri/env_logger/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sebasmagri/env_logger/git/refs{/sha}","trees_url":"https://api.github.com/repos/sebasmagri/env_logger/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sebasmagri/env_logger/statuses/{sha}","languages_url":"https://api.github.com/repos/sebasmagri/env_logger/languages","stargazers_url":"https://api.github.com/repos/sebasmagri/env_logger/stargazers","contributors_url":"https://api.github.com/repos/sebasmagri/env_logger/contributors","subscribers_url":"https://api.github.com/repos/sebasmagri/env_logger/subscribers","subscription_url":"https://api.github.com/repos/sebasmagri/env_logger/subscription","commits_url":"https://api.github.com/repos/sebasmagri/env_logger/commits{/sha}","git_commits_url":"https://api.github.com/repos/sebasmagri/env_logger/git/commits{/sha}","comments_url":"https://api.github.com/repos/sebasmagri/env_logger/comments{/number}","issue_comment_url":"https://api.github.com/repos/sebasmagri/env_logger/issues/comments{/number}","contents_url":"https://api.github.com/repos/sebasmagri/env_logger/contents/{+path}","compare_url":"https://api.github.com/repos/sebasmagri/env_logger/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sebasmagri/env_logger/merges","archive_url":"https://api.github.com/repos/sebasmagri/env_logger/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sebasmagri/env_logger/downloads","issues_url":"https://api.github.com/repos/sebasmagri/env_logger/issues{/number}","pulls_url":"https://api.github.com/repos/sebasmagri/env_logger/pulls{/number}","milestones_url":"https://api.github.com/repos/sebasmagri/env_logger/milestones{/number}","notifications_url":"https://api.github.com/repos/sebasmagri/env_logger/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sebasmagri/env_logger/labels{/name}","releases_url":"https://api.github.com/repos/sebasmagri/env_logger/releases{/id}","deployments_url":"https://api.github.com/repos/sebasmagri/env_logger/deployments","created_at":"2017-07-06T03:07:16Z","updated_at":"2018-02-28T10:31:42Z","pushed_at":"2018-03-09T02:03:10Z","git_url":"git://github.com/sebasmagri/env_logger.git","ssh_url":"git@github.com:sebasmagri/env_logger.git","clone_url":"https://github.com/sebasmagri/env_logger.git","svn_url":"https://github.com/sebasmagri/env_logger","homepage":null,"size":145,"stargazers_count":39,"watchers_count":39,"language":"Rust","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":20,"mirror_url":null,"archived":false,"open_issues_count":8,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0"},"forks":20,"open_issues":8,"watchers":39,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/sebasmagri/env_logger/pulls/66"},"html":{"href":"https://github.com/sebasmagri/env_logger/pull/66"},"issue":{"href":"https://api.github.com/repos/sebasmagri/env_logger/issues/66"},"comments":{"href":"https://api.github.com/repos/sebasmagri/env_logger/issues/66/comments"},"review_comments":{"href":"https://api.github.com/repos/sebasmagri/env_logger/pulls/66/comments"},"review_comment":{"href":"https://api.github.com/repos/sebasmagri/env_logger/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/sebasmagri/env_logger/pulls/66/commits"},"statuses":{"href":"https://api.github.com/repos/sebasmagri/env_logger/statuses/b374c317f5080f991fdbb1a57ee2c1e922c4e702"}},"author_association":"COLLABORATOR","merged":true,"mergeable":null,"rebaseable":null,"mergeable_state":"unknown","merged_by":{"login":"KodrAus","id":6721458,"avatar_url":"https://avatars0.githubusercontent.com/u/6721458?v=4","gravatar_id":"","url":"https://api.github.com/users/KodrAus","html_url":"https://github.com/KodrAus","followers_url":"https://api.github.com/users/KodrAus/followers","following_url":"https://api.github.com/users/KodrAus/following{/other_user}","gists_url":"https://api.github.com/users/KodrAus/gists{/gist_id}","starred_url":"https://api.github.com/users/KodrAus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/KodrAus/subscriptions","organizations_url":"https://api.github.com/users/KodrAus/orgs","repos_url":"https://api.github.com/users/KodrAus/repos","events_url":"https://api.github.com/users/KodrAus/events{/privacy}","received_events_url":"https://api.github.com/users/KodrAus/received_events","type":"User","site_admin":false},"comments":1,"review_comments":0,"maintainer_can_modify":false,"commits":5,"additions":312,"deletions":68,"changed_files":4}}
{"actor":{"display_login":"KodrAus"}}