Skip to content

Conversation

@deschuma
Copy link
Collaborator

  • Addresses Issue Enable logging if environment variable set #102 to enable logging to stdout independent of OE SDK
  • Implements OE SDK ask to enable testing without on-demand registration, if desired
  • Moves the environment variable functionality into a header file

return std::string();
}

auto retval = std::string(env_value);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why save to a local variable here before returning? Why not just return std::string(env_value);?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks fixed

Copy link
Member

@letmaik letmaik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

return std::string();
}
#endif
else

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

else [](start = 4, length = 4)

This 'else' is unnecessary. Both 'if' statements exit the function. Visually, it seems odd to share 'else' block by 2 'if' blocks.

{
log(SGX_QL_LOG_ERROR,
"Value specified in environment variable %s is either empty or "
"expected max length '%d'.",

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

%d [](start = 38, length = 2)

Missing an integer param for the %d.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks fixed

@soccerGB
Copy link
Member

The logging for parameters passed in sgx_ql_get_quote_config() is only on when the target was Not found in the cache. Could you take this chance to enable logging when cache was hit as well?

src/logging.cpp Outdated
using namespace std;

sgx_ql_logging_function_t logger_callback = nullptr;
static sgx_ql_log_level_t debug_log_level;
Copy link

@yentsanglee yentsanglee May 19, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

debug_log_level [](start = 26, length = 15)

Initialize it. #Closed

src/logging.cpp Outdated
if (logger_callback != nullptr)
{
logger_callback(level, message);
}else if (enable_debug_log)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Linefeed

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks - fixed

src/logging.cpp Outdated

sgx_ql_logging_function_t logger_callback = nullptr;
static sgx_ql_log_level_t debug_log_level;
bool enable_debug_log = false;
Copy link

@yentsanglee yentsanglee May 19, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

enable_debug_log [](start = 5, length = 16)

Minor suggestion - enable_debug_log is always coupled with debug_log_level. You can define something like "SGX_QL_LOG_NONE" to replace enable_debug_log being false.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks - fixed

@deschuma
Copy link
Collaborator Author

@soccerGB logging for parameters happens regardless of caching or not - is there a specific parameter I am missing?
1: Azure Quote Provider: libdcap_quoteprov.so [INFO]: Fetching quote config from cache: 'https://global.acccache.azure.net/sgx/certificates/v2/e40610aa353e1bb52385aba37e8acadb/0f0f0205ff8007000000000000000000/0a00/0000?clientid=production_client&api-version=2018-10-01-preview'.

@deschuma deschuma merged commit dde25eb into master May 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants