Skip to content

Commit 56253d6

Browse files
docs: update README formatting and branding (#531)
1 parent 242276f commit 56253d6

File tree

3 files changed

+32
-16
lines changed

3 files changed

+32
-16
lines changed

README.md

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,14 @@
88
[![npm version](https://img.shields.io/npm/v/@google-cloud/error-reporting.svg)](https://www.npmjs.org/package/@google-cloud/error-reporting)
99
[![codecov](https://img.shields.io/codecov/c/github/googleapis/nodejs-error-reporting/master.svg?style=flat)](https://codecov.io/gh/googleapis/nodejs-error-reporting)
1010

11+
12+
13+
1114
> Node.js idiomatic client for [Error Reporting][product-docs].
1215
1316
[Cloud Error Reporting](https://cloud.google.com/error-reporting/docs/) aggregates and displays errors produced in your running cloud services.
1417

18+
1519
A comprehensive list of changes in each version may be found in
1620
[the CHANGELOG](https://github.com/googleapis/nodejs-error-reporting/blob/master/CHANGELOG.md).
1721

@@ -26,6 +30,7 @@ Google APIs Client Libraries, in [Client Libraries Explained][explained].
2630

2731
**Table of contents:**
2832

33+
2934
* [Quickstart](#quickstart)
3035
* [Before you begin](#before-you-begin)
3136
* [Installing the client library](#installing-the-client-library)
@@ -39,9 +44,9 @@ Google APIs Client Libraries, in [Client Libraries Explained][explained].
3944

4045
### Before you begin
4146

42-
1. [Select or create a Cloud Platform project][projects].
43-
1. [Enable the Cloud Error Reporting API][enable_api].
44-
1. [Set up authentication with a service account][auth] so you can access the
47+
1. [Select or create a Cloud Platform project][projects].
48+
1. [Enable the Cloud Error Reporting API][enable_api].
49+
1. [Set up authentication with a service account][auth] so you can access the
4550
API from your local workstation.
4651

4752
### Installing the client library
@@ -50,6 +55,7 @@ Google APIs Client Libraries, in [Client Libraries Explained][explained].
5055
npm install @google-cloud/error-reporting
5156
```
5257

58+
5359
### Using the client library
5460

5561
```javascript
@@ -81,22 +87,19 @@ Here's an introductory video that provides some more details:
8187
# When Errors Are Reported
8288

8389
The `reportMode` configuration option is used to specify when errors are reported to the Error Reporting Console. It can have one of three values:
84-
8590
* `'production'` (default): Only report errors if the NODE_ENV environment variable is set to "production".
8691
* `'always'`: Always report errors regardless of the value of NODE_ENV.
8792
* `'never'`: Never report errors regardless of the value of NODE_ENV.
8893

8994
The `reportMode` configuration option replaces the deprecated `ignoreEnvironmentCheck` configuration option. If both the `reportMode` and `ignoreEnvironmentCheck` options are specified, the `reportMode` configuration option takes precedence.
9095

9196
The `ignoreEnvironmentCheck` option should not be used. However, if it is used, and the `reportMode` option is not specified, it can have the values:
92-
9397
* `false` (default): Only report errors if the NODE_ENV environment variable is set to "production".
9498
* `true`: Always report errors regardless of the value of NODE_ENV.
9599

96100
See the [Configuration](#configuration) section to learn how to specify configuration options.
97101

98102
## Configuration
99-
100103
The following code snippet lists available configuration options. All configuration options are optional.
101104

102105
```js
@@ -153,7 +156,6 @@ errors.report('My error message');
153156
```
154157

155158
The stack trace associated with an error can be viewed in the error reporting console.
156-
157159
* If the `errors.report` method is given an `ErrorMessage` object built using the `errors.event` method, the stack trace at the point where the error event was constructed will be used.
158160
* If the `errors.report` method is given an `Error` object, the stack trace where the error was instantiated will be used.
159161
* If the `errors.report` method is given a string, the stack trace at the point where `errors.report` is invoked will be used.
@@ -332,7 +334,6 @@ The [longjohn](https://www.npmjs.com/package/longjohn) module can be used with t
332334
Before reporting an `Error` object using the `report` method of the `@google-cloud/error-reporting` module, the stack trace needs to modified to remove this special line added by `longjohn`. Since the `longjohn` module can be configured to have a custom line indicating an async jump, the process of removing the custom line should be handled by the user of the `longjohn` module.
333335

334336
The following code illustrates how to update an `Error`'s stack trace, to remove the default line of dashes added by `longjohn` to indicate an async jump, before reporting the error.
335-
336337
```js
337338
const {ErrorReporting} = require('@google-cloud/error-reporting');
338339

@@ -346,6 +347,7 @@ err.stack = (err.stack || '').split('\n')
346347
errors.report(err);
347348
```
348349

350+
349351
## Samples
350352

351353
Samples are in the [`samples/`](https://github.com/googleapis/nodejs-error-reporting/tree/master/samples) directory. The samples' `README.md`
@@ -359,6 +361,8 @@ has instructions for running the samples.
359361
| Manual reporting | [source code](https://github.com/googleapis/nodejs-error-reporting/blob/master/samples/manual.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-error-reporting&page=editor&open_in_editor=samples/manual.js,samples/README.md) |
360362
| Quickstart | [source code](https://github.com/googleapis/nodejs-error-reporting/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-error-reporting&page=editor&open_in_editor=samples/quickstart.js,samples/README.md) |
361363

364+
365+
362366
The [Cloud Error Reporting Node.js Client API Reference][client-docs] documentation
363367
also contains samples.
364368

@@ -378,7 +382,7 @@ _Legacy Node.js versions are supported as a best effort:_
378382
* Some security patches may not be able to be backported.
379383
* Dependencies will not be kept up-to-date, and features will not be backported.
380384

381-
### Legacy tags available
385+
#### Legacy tags available
382386

383387
* `legacy-8`: install client libraries from this dist-tag for versions
384388
compatible with Node.js 8.
@@ -387,11 +391,16 @@ _Legacy Node.js versions are supported as a best effort:_
387391

388392
This library follows [Semantic Versioning](http://semver.org/).
389393

394+
395+
390396
This library is considered to be in **beta**. This means it is expected to be
391397
mostly stable while we work toward a general availability release; however,
392398
complete stability is not guaranteed. We will address issues and requests
393399
against beta libraries with a high priority.
394400

401+
402+
403+
395404
More Information: [Google Cloud Platform Launch Stages][launch_stages]
396405

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

samples/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
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 Error Reporting: Node.js Samples](https://github.com/googleapis/nodejs-error-reporting)
5+
# [Cloud Error Reporting: Node.js Samples](https://github.com/googleapis/nodejs-error-reporting)
66

77
[![Open in Cloud Shell][shell_img]][shell_link]
88

99
> Node.js idiomatic client for [Error Reporting][product-docs].
1010
11-
[Stackdriver Error Reporting](https://cloud.google.com/error-reporting/docs/) aggregates and displays errors produced in your running cloud services.
11+
[Cloud Error Reporting](https://cloud.google.com/error-reporting/docs/) aggregates and displays errors produced in your running cloud services.
1212

1313
## Table of Contents
1414

synth.metadata

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,15 @@
33
{
44
"git": {
55
"name": ".",
6-
"remote": "git@github.com:googleapis/nodejs-error-reporting.git",
7-
"sha": "1ad83651e52a6a87e4e6946f6e05526a5be101d6"
6+
"remote": "https://github.com/googleapis/nodejs-error-reporting.git",
7+
"sha": "242276fff3e81cfac7a7b8294273cced203bccd6"
8+
}
9+
},
10+
{
11+
"git": {
12+
"name": "synthtool",
13+
"remote": "https://github.com/googleapis/synthtool.git",
14+
"sha": "ba9918cd22874245b55734f57470c719b577e591"
815
}
916
}
1017
],
@@ -58,10 +65,10 @@
5865
"LICENSE",
5966
"README.md",
6067
"api-extractor.json",
61-
"package-lock.json.1637601552",
62-
"package-lock.json.1766790967",
68+
"package-lock.json.3795722890",
69+
"package-lock.json.3860750886",
6370
"renovate.json",
6471
"samples/README.md",
65-
"samples/package-lock.json.2310227638"
72+
"samples/package-lock.json.2996125530"
6673
]
6774
}

0 commit comments

Comments
 (0)