{"action":"opened","issue":{"url":"https://api.github.com/repos/kmsquire/Logging.jl/issues/16","labels_url":"https://api.github.com/repos/kmsquire/Logging.jl/issues/16/labels{/name}","comments_url":"https://api.github.com/repos/kmsquire/Logging.jl/issues/16/comments","events_url":"https://api.github.com/repos/kmsquire/Logging.jl/issues/16/events","html_url":"https://github.com/kmsquire/Logging.jl/issues/16","id":67238813,"number":16,"title":"Instrumenting a module with logging","user":{"login":"dpo","id":38760,"avatar_url":"https://avatars.githubusercontent.com/u/38760?v=3","gravatar_id":"","url":"https://api.github.com/users/dpo","html_url":"https://github.com/dpo","followers_url":"https://api.github.com/users/dpo/followers","following_url":"https://api.github.com/users/dpo/following{/other_user}","gists_url":"https://api.github.com/users/dpo/gists{/gist_id}","starred_url":"https://api.github.com/users/dpo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dpo/subscriptions","organizations_url":"https://api.github.com/users/dpo/orgs","repos_url":"https://api.github.com/users/dpo/repos","events_url":"https://api.github.com/users/dpo/events{/privacy}","received_events_url":"https://api.github.com/users/dpo/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-04-08T23:01:17Z","updated_at":"2015-04-08T23:01:17Z","closed_at":null,"body":"How do you suggest one instrument a module with logging? In the situation I have in mind, functions exported by the module call logging macros, but logging is turned off by default. Users should be able to enable logging in their own scripts if they want to. Something in the vein of\r\n\r\n````JULIA\r\nmodule SomeModule\r\n\r\nexport some_function;\r\n\r\nusing Logging\r\n@Logging.configure(level=OFF)\r\n\r\nfunction some_function()\r\n  @debug(\"Run for cover!\")\r\nend\r\nend\r\n````\r\n\r\nIn the user's script,\r\n````JULIA\r\nusing SomeModule\r\nusing Logging\r\nmy_logger = Logger(\"MyLogger\")\r\nLogging.configure(my_logger, level=DEBUG)\r\nsome_function()\r\n````\r\n\r\nI can't seem to find the intended syntax to achieve this."}}