Skip to content

Commit f36f61d

Browse files
YulunWmeta-codesync[bot]
authored andcommitted
Clean up noisy logs
Summary: Previously, we were having two logs that will display on every job: ``` E1023 11:34:59.640702 2378951 Logger.cc:164] Thread Context Fn dict does not contain prefix NCCL W1023 11:34:59.640872 2378951 Logger.cc:144] devvm26668:2378951:2378951 [0][main] NCCL WARN Prefix NCCL re-registering thread context fn ``` This is due to our change to logger. This has caused difficulty for developers to look at the log in jobs. Remove these logs by: 1. Change re-registering thread context fn log to debug level. 2. Add context fn to prefix in logger initialization. Reviewed By: minsii Differential Revision: D85368422 fbshipit-source-id: dce116fea80612ea4555c568ba657ae31f91424a
1 parent 0bb846d commit f36f61d

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

comms/utils/logger/Logger.cc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ void NcclLogger::init(const NcclLoggerInitConfig& config) {
2929
if (!firstInit_.test_and_set()) {
3030
folly::initLoggingOrDie();
3131
DataTableWrapper::init();
32+
NcclLogFormatterFactory::registerThreadContextFn(
33+
config.logPrefix, config.threadContextFn);
3234
NcclLogger::registerHandler(
3335
{.contextName = "comms.utils",
3436
.logPrefix = config.logPrefix,
@@ -142,7 +144,7 @@ void NcclLogFormatterFactory::registerThreadContextFn(
142144
std::string_view name,
143145
std::function<int(void)> threadContextFn) {
144146
if (getPrefixToThreadContextFnMap().contains(std::string{name})) {
145-
XLOGF(WARN, "Prefix {} re-registering thread context fn", name);
147+
XLOGF(DBG1, "Prefix {} re-registering thread context fn", name);
146148
}
147149
getPrefixToThreadContextFnMap().insert_or_assign(
148150
std::string{name}, threadContextFn);

0 commit comments

Comments
 (0)