Skip to content

Commit

Permalink
Merge pull request #36 from BurtBiel/burtbiel/LibraryLogging2
Browse files Browse the repository at this point in the history
hook up msrest logging to our logger (they only log in debug level) [Finished #114442727]
  • Loading branch information
mayurid committed Mar 10, 2016
2 parents caa0277 + 68428fa commit 6ec0c20
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 2 additions & 0 deletions azure-cli.pyproj
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,12 @@
<Compile Include="azure\cli\tests\test_autocommand.py" />
<Compile Include="azure\cli\tests\test_connection_verify.py" />
<Compile Include="azure\cli\tests\test_output.py" />
<Compile Include="azure\cli\_debug.py" />
<Compile Include="azure\cli\_locale.py" />
<Compile Include="azure\cli\tests\test_profile.py" />
<Compile Include="azure\cli\_argparse.py" />
<Compile Include="azure\cli\_logging.py" />
<Compile Include="azure\cli\_output.py" />
<Compile Include="azure\cli\_profile.py" />
<Compile Include="azure\cli\_session.py">
<SubType>Code</SubType>
Expand Down
8 changes: 7 additions & 1 deletion src/azure/cli/commands/_command_creation.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
from .._profile import Profile
import azure.cli._debug as _debug
import azure.cli as cli
from .._logging import logger

def get_mgmt_service_client(client_type, config_type):
profile = Profile()
client = client_type(config_type(*profile.get_login_credentials()))
config = config_type(*profile.get_login_credentials())
config.log_name = 'az'
config.log_level = logger.level

client = client_type(config)
_debug.allow_debug_connection(client)
client.config.add_user_agent("AZURECLI_{}".format(cli.__version__))

return client

def get_data_service_client(service_type, account_name, account_key):
Expand Down

0 comments on commit 6ec0c20

Please sign in to comment.