Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@google-cloud/logging

Package Overview
Dependencies
Maintainers
1
Versions
157
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@google-cloud/logging - npm Package Compare versions

Comparing version 9.5.1 to 9.5.2

4

build/src/entry.js

@@ -180,5 +180,5 @@ "use strict";

// Mask out the keys that need to be renamed.
// eslint-disable @typescript-eslint/no-unused-vars
/* eslint-disable @typescript-eslint/no-unused-vars */
const { textPayload, jsonPayload, insertId, trace, spanId, traceSampled, operation, sourceLocation, labels, ...validKeys } = meta;
// eslint-enable @typescript-eslint/no-unused-vars
/* eslint-enable @typescript-eslint/no-unused-vars */
const entry = extend(true, {}, validKeys);

@@ -185,0 +185,0 @@ // Re-map keys names.

@@ -7,2 +7,9 @@ # Changelog

### [9.5.2](https://www.github.com/googleapis/nodejs-logging/compare/v9.5.1...v9.5.2) (2021-06-30)
### Bug Fixes
* **deps:** require google-gax v2.17.0 ([#1111](https://www.github.com/googleapis/nodejs-logging/issues/1111)) ([d64d671](https://www.github.com/googleapis/nodejs-logging/commit/d64d67190dddf0318ca47eb8528e4b9052e3a9c0))
### [9.5.1](https://www.github.com/googleapis/nodejs-logging/compare/v9.5.0...v9.5.1) (2021-06-23)

@@ -9,0 +16,0 @@

{
"name": "@google-cloud/logging",
"version": "9.5.1",
"version": "9.5.2",
"description": "Stackdriver Logging Client Library for Node.js",

@@ -58,3 +58,3 @@ "keywords": [

"google-auth-library": "^7.0.0",
"google-gax": "^2.12.0",
"google-gax": "^2.17.0",
"on-finished": "^2.3.0",

@@ -61,0 +61,0 @@ "pumpify": "^2.0.1",

@@ -120,3 +120,39 @@ [//]: # "This README.md file is auto-generated, all changes to this file will be lost."

## Writing to Stdout
The `LogSync` class helps users easily write context-rich structured logs to
`stdout` or any custom transport. It extracts additional log properties like
trace context from HTTP headers and can be used as an on/off toggle between
writing to the API or to `stdout` during local development.
Logs written to `stdout` are then picked up, out-of-process, by a Logging
agent in the respective GCP environment. Logging agents can add more
properties to each entry before streaming it to the Logging API.
Read more about [Logging agents](https://cloud.google.com/logging/docs/agent/logging).
Serverless applications like Cloud Functions, Cloud Run, and App Engine
are highly recommended to use the `LogSync` class as async logs may be dropped
due to lack of CPU.
Read more about [structured logging](https://cloud.google.com/logging/docs/structured-logging).
```js
// Optional: Create and configure a client
const logging = new Logging();
await logging.setProjectId()
await logging.setDetectedResource()
// Create a LogSync transport, defaulting to `process.stdout`
const log = logging.logSync(logname);
const meta = { // optional field overrides here };
const entry = log.entry(meta, 'Your log message');
log.write(entry);
// Syntax sugar for logging at a specific severity
log.alert(entry);
log.warning(entry);
```
## Samples

@@ -123,0 +159,0 @@

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc