Skip to content
This repository was archived by the owner on Sep 19, 2022. It is now read-only.

Commit 528ec6e

Browse files
Merge pull request #170 from BaranekD/logging_modifications
fix: Each log has just one line output
2 parents 5e4d27c + 837a8fd commit 528ec6e

File tree

5 files changed

+9
-8
lines changed

5 files changed

+9
-8
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ All notable changes to this project will be documented in this file.
66
- Detailed endpoint format when spaced in EndpointMapToArray
77
- Revert change to INDEX_MIN in EndpointMapToArray
88
- Rename the hook correctly to naming convention
9+
- Each log has just one line output
910

1011
## [v5.2.0]
1112
#### Added

lib/AdapterLdap.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -390,7 +390,7 @@ public function getUsersGroupsOnFacility($spEntityId, $userId)
390390
'(&(objectClass=perunResource)(perunFacilityDn=perunFacilityId=' . $id . ',' . $this->ldapBase . '))',
391391
['perunResourceId']
392392
);
393-
Logger::debug('Resources - ' . var_export($resources, true));
393+
Logger::debug('Resources - ' . json_encode($resources));
394394

395395
if ($resources === null) {
396396
throw new Exception(
@@ -424,7 +424,7 @@ public function getUsersGroupsOnFacility($spEntityId, $userId)
424424
);
425425
}
426426
$resultGroups = $this->removeDuplicateEntities($resultGroups);
427-
Logger::debug('Groups - ' . var_export($resultGroups, true));
427+
Logger::debug('Groups - ' . json_encode($resultGroups));
428428
return $resultGroups;
429429
}
430430

lib/Auth/Process/ForceAup.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ public function process(&$request)
205205
$newAups = [];
206206
}
207207

208-
Logger::debug('perun:ForceAup - NewAups: ' . print_r($newAups, true));
208+
Logger::debug('perun:ForceAup - NewAups: ' . json_encode($newAups));
209209

210210
if (!empty($newAups)) {
211211
$request[self::UID_ATTR] = $this->uidAttr;

lib/Auth/Process/PerunIdentity.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -574,10 +574,10 @@ protected function getVosForRegistration($user)
574574

575575
$vos = $this->getVosByFacilityVoShortNames();
576576
foreach ($vos as $vo) {
577-
Logger::debug('Vo:' . print_r($vo, true));
577+
Logger::debug('Vo:' . json_encode($vo));
578578
try {
579579
$member = $this->rpcAdapter->getMemberByUser($user, $vo);
580-
Logger::debug('Member:' . print_r($member, true));
580+
Logger::debug('Member:' . json_encode($member));
581581
array_push($members, $member);
582582
} catch (\Exception $exception) {
583583
array_push($vosForRegistration, $vo);
@@ -597,7 +597,7 @@ protected function getVosForRegistration($user)
597597
array_push($vosForRegistration, $vo);
598598
}
599599
}
600-
Logger::debug('VOs for registration: ' . print_r($vosForRegistration, true));
600+
Logger::debug('VOs for registration: ' . json_encode($vosForRegistration));
601601
return $vosForRegistration;
602602
}
603603

lib/LdapConnector.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ protected function search($base, $filter, $attributes = null)
111111
}
112112

113113
ldap_set_option($conn, LDAP_OPT_PROTOCOL_VERSION, 3);
114-
114+
115115
// Enable TLS, if needed
116116
if ($this->enableTLS && stripos($this->hostname, "ldaps:") === false) {
117117
if (!@ldap_start_tls($conn)) {
@@ -142,7 +142,7 @@ protected function search($base, $filter, $attributes = null)
142142
ldap_close($conn);
143143

144144
Logger::debug('sspmod_perun_LdapConnector.search - search query proceeded in ' . $responseTime . 'ms. ' .
145-
'Query base: ' . $base . ', filter: ' . $filter . ', response: ' . var_export($entries, true));
145+
'Query base: ' . $base . ', filter: ' . $filter . ', response: ' . json_encode($entries));
146146

147147
return $entries;
148148
}

0 commit comments

Comments
 (0)