question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

clasp logs returns strange output

See original GitHub issue

Expected Behavior

Returns logs from Logger.log('stuff')

Actual Behavior

Returns the following:

NOTICE     2018-02-16T09:57:48.779Z N/A [object Object]
NOTICE     2018-02-16T09:57:50.111Z N/A [object Object]
NOTICE     2018-02-16T09:57:50.800Z N/A [object Object]
NOTICE     2018-02-16T09:57:51.520Z N/A [object Object]
NOTICE     2018-02-16T09:58:25.946Z N/A [object Object]
NOTICE     2018-02-16T09:58:26.353Z N/A [object Object]
(node:78635) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): TypeError: Cannot read property 'message' of undefined
(node:78635) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

instead of Logs

Steps to Reproduce the Problem

As this error might be a google project config problem, there’s no poit in trying to reproduce it.

Specifications

  • Node version: 9
  • Version: 1.3.2
  • OS: Mac

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:8 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
shaicommented, Jun 17, 2018

You guys are awesome! Thanks for taking this issue and applying a fix for it so quickly 😃 Looking forward to the next release…

1reaction
campionfellincommented, Jun 16, 2018

Hey @nirazul and @shai hopefully I can give some clarity on this. Those first few logs that you see with NOTICE 2018-06-07T06:19:17.337Z N/A [object Object] etc. look like this:

{ protoPayload:
   { '@type': 'type.googleapis.com/google.cloud.audit.AuditLog',
     status: {},
     authenticationInfo: { principalEmail: 'myemail@gmail.com' },
     requestMetadata: { callerIp: 'xx.xx.xxxx' },
     serviceName: 'clientauthconfig.googleapis.com',
     methodName: 'CreateBrand',
     authorizationInfo: [ [Object] ],
     resourceName: 'brands/xxxxxx',
     request: { brand: [Object] },
     response:
      { supportEmail: 'myemail@gmail.com',
        displayName: 'myTitle',
        review: [Object],
        brandId: 'xxxx',
        updateTime: '2018-06-06T02:20:56.402287Z',
        projectNumbers: [Array] } },
  insertId: 'xxxxxx',
  resource:
   { type: 'client_auth_config_brand',
     labels:
      { brand_id: 'xxxxxx',
        project_id: 'project-id-xxxx' } },
  timestamp: '2018-06-06T02:20:56.100Z',
  severity: 'NOTICE',
  logName: 'projects/project-id-xxxx/logs/cloudaudit.googleapis.com%2Factivity',
  receiveTimestamp: '2018-06-06T02:20:57.285206438Z' }

which, to my understanding is just Apps Scripts setting up the StackDriver logging.

You can see that in the StackDriver Logging UI with this URL https://console.cloud.google.com/logs/viewer?project=project-id-xxxxxxxx&resource=project (replacing xxxxx with your project-id. You can also get there through StackDriver by clicking here:

screen shot 2018-06-16 at 3 49 22 pm

However, when using clasp logs I think we should either hide these logs or give them a friendlier message.

As far as getting older logs, it looks like the API has it set to old --> new by default. I can go ahead and switch that to get most recent first.

Please let me know if this helps, and what else you’d like to see improved!

Read more comments on GitHub >

github_iconTop Results From Across the Web

2 same string are not equal in bash - Stack Overflow
The condition print_logs never gets activated, even if both returns print equal to the console. I am on a mac if it makes...
Read more >
Google Apps Script & Web App Debugging - YouTube
Learn how to debug your Google Apps Script code or Web App. In this tutorial we'll talk about simple troubleshooting tools available to ......
Read more >
Command Line Interface using clasp | Apps Script
This command logs in and authorizes management of your Google account's Apps Script projects. Once it is run, you are asked to sign...
Read more >
Migration of Clips after Laparoscopic Cholecystectomy - NCBI
Postcholecystectomy clip migration is rare and can lead to complications such as clip-related biliary stones. Most of such incidents have been reported as ......
Read more >
The CLASP Application Security Process Secure Software, Inc.
This usually results in over-reliance on poorly understood security technologies. For example, SSL is the most popular means of providing data ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found