зеркало из https://github.com/Azure/sf-c-util.git
add LogHRESULTVerbose (#187)
* add LogHRESULTVerbose * replace everywhere
This commit is contained in:
Родитель
8ab027e805
Коммит
15bea1e376
|
@ -81,3 +81,18 @@ wchar_t* hresult_to_wstring(HRESULT hresult);
|
|||
|
||||
`LogHRESULTError` will behave as if `LogError(FORMAT, ...)` would have been called and it will append " HRESULT=<<human readable string>>" as obtained from `hresult_to_string`.
|
||||
|
||||
### LogHRESULTInfo
|
||||
```c
|
||||
#define LogHRESULTInfo(hr, FORMAT, ...)
|
||||
```
|
||||
|
||||
`LogHRESULTInfo` will behave as if `LogInfo(FORMAT, ...)` would have been called and it will append " HRESULT=<<human readable string>>" as obtained from `hresult_to_string`.
|
||||
|
||||
|
||||
### LogHRESULTVerbose
|
||||
```c
|
||||
#define LogHRESULTVerbose(hr, FORMAT, ...)
|
||||
```
|
||||
|
||||
`LogHRESULTVerbose` will behave as if `LogVerbose(FORMAT, ...)` would have been called and it will append " HRESULT=<<human readable string>>" as obtained from `hresult_to_string`.
|
||||
|
||||
|
|
|
@ -39,9 +39,9 @@ extern "C" {
|
|||
will return NULL if it cannot determine the meaning (or it fails internally)
|
||||
in order will try to find the meaning of the HRESULT as follows:
|
||||
1) system (as defined in FORMAT_MESSAGE_FROM_SYSTEM)
|
||||
2) service fabric's code
|
||||
2) service fabric's code
|
||||
3) every other loaded module
|
||||
|
||||
|
||||
caller needs to dispose (call free()) of the string (note the missing "const" from the return value)
|
||||
*/
|
||||
char* hresult_to_string(malloc_t the_malloc, free_t the_free, HRESULT hresult);
|
||||
|
@ -90,8 +90,9 @@ extern "C" {
|
|||
#define LogHRESULT(log_macro, hr, ...) do{MU_IF(MU_COUNT_ARG(__VA_ARGS__), LogHRESULTWithFormat (log_macro, hr, __VA_ARGS__);, LogHRESULTWithoutFormat (log_macro, hr);)}while(0)
|
||||
#endif /*VS 2017/2019*/
|
||||
|
||||
#define LogHRESULTError(hr, ...) LogHRESULT(LogError, hr, __VA_ARGS__)
|
||||
#define LogHRESULTInfo(hr, ...) LogHRESULT(LogInfo, hr, __VA_ARGS__)
|
||||
#define LogHRESULTError(hr, ...) LogHRESULT(LogError, hr, __VA_ARGS__)
|
||||
#define LogHRESULTInfo(hr, ...) LogHRESULT(LogInfo, hr, __VA_ARGS__)
|
||||
#define LogHRESULTVerbose(hr, ...) LogHRESULT(LogVerbose, hr, __VA_ARGS__)
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче