Skip to content

Commit ae8e373

Browse files
theanalystesindril
authored andcommitted
MGM: Quota: fix debug log printing
Signed-off-by: Abhishek Lekshmanan <abhishek.lekshmanan@cern.ch>
1 parent 11572a8 commit ae8e373

1 file changed

Lines changed: 12 additions & 9 deletions

File tree

mgm/Quota.cc

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,7 @@ SpaceQuota::UpdateTargetSums()
315315
return;
316316
}
317317

318-
eos_debug("updating targets");
318+
eos_debug("%s", "updating targets");
319319
XrdSysMutexHelper scope_lock(mMutex);
320320
mDirtyTarget = false;
321321
mMapIdQuota[Index(kAllUserBytesTarget, 0)] = 0;
@@ -355,7 +355,7 @@ SpaceQuota::UpdateTargetSums()
355355
void
356356
SpaceQuota::UpdateIsSums()
357357
{
358-
eos_debug("updating IS values");
358+
eos_debug("%s", "updating IS values");
359359
XrdSysMutexHelper scope_lock(mMutex);
360360
mMapIdQuota[Index(kAllUserBytesIs, 0)] = 0;
361361
mMapIdQuota[Index(kAllUserLogicalBytesIs, 0)] = 0;
@@ -414,7 +414,7 @@ SpaceQuota::UpdateIsSums()
414414
void
415415
SpaceQuota::UpdateFromQuotaNode(uid_t uid, gid_t gid, bool upd_proj_quota)
416416
{
417-
eos_debug("updating uid/gid values from quota node");
417+
eos_debug("%s", "updating uid/gid values from quota node");
418418
XrdSysMutexHelper scope_lock(mMutex);
419419

420420
if (mQuotaNode) {
@@ -588,14 +588,17 @@ SpaceQuota::PrintOut(XrdOucString& output, long long int uid_sel,
588588
uids.erase(std::unique(uids.begin(), uids.end()), uids.end());
589589
std::sort(gids.begin(), gids.end());
590590
gids.erase(std::unique(gids.begin(), gids.end()), gids.end());
591-
eos_debug("sorted");
592591

593-
for (unsigned int i = 0; i < uids.size(); ++i) {
594-
eos_debug("sort %d %d", i, uids[i].second);
595-
}
592+
if (EOS_LOGS_DEBUG) {
593+
eos_debug("%s","sorted");
594+
595+
for (unsigned int i = 0; i < uids.size(); ++i) {
596+
eos_debug("sort %d %d", i, uids[i].second);
597+
}
596598

597-
for (unsigned int i = 0; i < gids.size(); ++i) {
598-
eos_debug("sort %d %d", i, gids[i].second);
599+
for (unsigned int i = 0; i < gids.size(); ++i) {
600+
eos_debug("sort %d %d", i, gids[i].second);
601+
}
599602
}
600603

601604
// Print the header for selected uid/gid's only if there is something to print

0 commit comments

Comments
 (0)