Skip to content

Commit

Permalink
hook up msrest logging to our logger (they only log in debug level)
Browse files Browse the repository at this point in the history
  • Loading branch information
BurtBiel committed Mar 4, 2016
1 parent c32ec59 commit 68428fa
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
7 changes: 7 additions & 0 deletions azure-cli.pyproj
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,12 @@
<Compile Include="azure\cli\commands\account.py" />
<Compile Include="azure\cli\commands\login.py" />
<Compile Include="azure\cli\commands\logout.py" />
<Compile Include="azure\cli\commands\network.py" />
<Compile Include="azure\cli\commands\resourcegroup.py" />
<Compile Include="azure\cli\commands\storage.py" />
<Compile Include="azure\cli\commands\vm.py" />
<Compile Include="azure\cli\commands\_auto_command.py" />
<Compile Include="azure\cli\commands\_command_creation.py" />
<Compile Include="azure\cli\commands\__init__.py" />
<Compile Include="azure\cli\main.py" />
<Compile Include="azure\cli\tests\test_argparse.py">
Expand All @@ -34,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,10 +1,16 @@
from .._profile import Profile
import azure.cli._debug as _debug
import azure.cli as cli
from .._logging import logger

def get_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

0 comments on commit 68428fa

Please sign in to comment.