Skip to content

Commit

Permalink
clean up debug log
Browse files Browse the repository at this point in the history
Revert: fbd67ba, e35dd41, 0324db3, 173d43c, ddd013c, b03c5df
  • Loading branch information
rpuboh committed Jul 1, 2024
1 parent 50042d0 commit 7ba683a
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 17 deletions.
12 changes: 0 additions & 12 deletions includes/json/JsonCodec.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@
use InvalidArgumentException;
use JsonSerializable;
use Wikimedia\Assert\Assert;
use CacheTime;
use MediaWiki\Json\JsonUnserializable;

/**
* Helper class to serialize/unserialize things to/from JSON.
Expand Down Expand Up @@ -89,20 +87,10 @@ public function unserializeArray( array $array ): array {
}

public function serialize( $value ) {
$valclass = get_class($value);
$v1 = $value instanceof JsonSerializable;
$v2 = $value instanceof CacheTime;
$v3 = $value instanceof JsonUnserializable;
if ( $value instanceof JsonSerializable ) {
wfDebugLog('pcd', "JC: calling jsonSerialize");
$value = $value->jsonSerialize();
} elseif ( $value instanceof CacheTime ) {
$value = $value->jsonSerialize();
}
$json = FormatJson::encode( $value, false, FormatJson::ALL_OK );
wfDebugLog('pcd', "JC: $valclass; $json");
wfDebugLog('pcd', "JsonSerializable $v1; CacheTime $v2; JsonUnserializable $v3");
usleep(1000);
if ( !$json ) {
// TODO: make it JsonException
throw new InvalidArgumentException(
Expand Down
2 changes: 0 additions & 2 deletions includes/json/JsonUnserializableTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@
trait JsonUnserializableTrait {

public function jsonSerialize(): array {
wfDebugLog('pcd', "JT::jsonSerialize");
usleep(2000);
return $this->annotateJsonForDeserialization(
$this->toJsonArray()
);
Expand Down
3 changes: 0 additions & 3 deletions includes/parser/ParserOutput.php
Original file line number Diff line number Diff line change
Expand Up @@ -2487,9 +2487,6 @@ protected function toJsonArray(): array {
$data['MaxAdaptiveExpiry'] = $this->mMaxAdaptiveExpiry;
}

$trunc_data = substr(json_encode($data, JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE), 0, 35);
wfDebugLog('pcd', "ParserOutput: $trunc_data");

return $data;
}

Expand Down

0 comments on commit 7ba683a

Please sign in to comment.