Skip to content

Commit 8beeb47

Browse files
shoumikhinfacebook-github-bot
authored andcommitted
Skip querying for current ticks for filtered out logs. (#2300)
Summary: bypass-github-pytorch-ci-checks Reviewed By: kirklandsign Differential Revision: D54646899
1 parent 424f1a9 commit 8beeb47

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

runtime/platform/log.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,10 +148,10 @@ inline void logf(
148148
*/
149149
#define ET_LOG(_level, _format, ...) \
150150
({ \
151-
et_timestamp_t _timestamp = torch::executor::internal::getLogTimestamp(); \
152-
auto _log_level = torch::executor::LogLevel::_level; \
151+
const auto _log_level = torch::executor::LogLevel::_level; \
153152
if (static_cast<uint32_t>(_log_level) >= \
154153
static_cast<uint32_t>(torch::executor::LogLevel::ET_MIN_LOG_LEVEL)) { \
154+
const auto _timestamp = torch::executor::internal::getLogTimestamp(); \
155155
torch::executor::internal::logf( \
156156
_log_level, \
157157
_timestamp, \

0 commit comments

Comments
 (0)