Skip to content

logging: throw when a circular reference is used in an entry#1664

Merged
callmehiphop merged 2 commits intogoogleapis:masterfrom
stephenplusplus:spp--1354
Oct 5, 2016
Merged

logging: throw when a circular reference is used in an entry#1664
callmehiphop merged 2 commits intogoogleapis:masterfrom
stephenplusplus:spp--1354

Conversation

@stephenplusplus
Copy link
Copy Markdown
Contributor

Fixes #1354

Before

var entry = {
  val: true
};
entry.circularReference = entry;

var entry = log.entry(resource, circularReference);

log.write(entry, ...);
RangeError: Maximum call stack size exceeded
  ... Long stack trace ...

After

var entry = {
  val: true
};
entry.circularReference = entry;

var entry = log.entry(resource, circularReference);

log.write(entry, ...);
Error: The JSON data for this entry has a circular reference.

@stephenplusplus stephenplusplus added the api: logging Issues related to the Cloud Logging API. label Oct 3, 2016
@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Oct 3, 2016
@coveralls
Copy link
Copy Markdown

Coverage Status

Coverage remained the same at 100.0% when pulling 8ce0a2c on stephenplusplus:spp--1354 into 009bc99 on GoogleCloudPlatform:master.

@coveralls
Copy link
Copy Markdown

Coverage Status

Coverage remained the same at 100.0% when pulling 8f0f942 on stephenplusplus:spp--1354 into 009bc99 on GoogleCloudPlatform:master.

* @private
*/
Entry.prototype.toJSON = function() {
if (is.object(this.data) && isCircular([this.data])) {

This comment was marked as spam.

@callmehiphop callmehiphop merged commit 10cd2ac into googleapis:master Oct 5, 2016
GautamSharda pushed a commit that referenced this pull request Mar 11, 2026
…will be rotated (#1664)

* build: have Kokoro grab service account credentials from secret that will be rotated

Source-Link: https://togithub.com/googleapis/synthtool/commit/4a0230eb8dc497f36fd3839e6144982131f30a9d
Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-nodejs:latest@sha256:f59941869d508c6825deeffce180579545fd528f359f549a80a18ec0458d7094
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api: logging Issues related to the Cloud Logging API. cla: yes This human has signed the Contributor License Agreement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants