Skip to content

Commit 70d2689

Browse files
authored
Renaming to generalize AI editors; adding logger fmt details (#13940)
* Fixes titles for the AI snippets to be more generic * Adds clarity for logger.fmt which was missing from log snippets
1 parent 6a97429 commit 70d2689

File tree

7 files changed

+35
-18
lines changed

7 files changed

+35
-18
lines changed

platform-includes/llm-rules-logs/javascript.nextjs.mdx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
<Expandable title="Logger Rules for Cursor or Windsurf" copy={true}>
1+
<Expandable title="AI Rules for Logs in Code Editors" copy={true}>
22

3+
When created as a rules file this should be placed alongside other editor specific rule files. For example, if you are using Cursor, place this file in the `.cursorrules` directory.
34

45
````markdown {filename:rules.md}
56

@@ -43,13 +44,15 @@ Sentry.init({
4344

4445
## Logger Examples
4546

47+
`logger.fmt` is a template literal function that should be used to bring variables into the structured logs.
48+
4649
```javascript
4750
import * as Sentry from "@sentry/nextjs";
4851

4952
const { logger } = Sentry;
5053

5154
logger.trace("Starting database connection", { database: "users" });
52-
logger.debug("Cache miss for user", { userId: 123 });
55+
logger.debug(logger.fmt`Cache miss for user: ${userId}`);
5356
logger.info("Updated profile", { profileId: 345 });
5457
logger.warn("Rate limit reached for endpoint", {
5558
endpoint: "/api/results/",

platform-includes/llm-rules-logs/javascript.node.mdx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
<Expandable title="Logger Rules for Cursor or Windsurf" copy={true}>
1+
<Expandable title="AI Rules for Logs in Code Editors" copy={true}>
22

3+
When created as a rules file this should be placed alongside other editor specific rule files. For example, if you are using Cursor, place this file in the `.cursorrules` directory.
34

45
````markdown {filename:rules.md}
56

@@ -43,13 +44,15 @@ Sentry.init({
4344

4445
## Logger Examples
4546

47+
`logger.fmt` is a template literal function that should be used to bring variables into the structured logs.
48+
4649
```javascript
4750
import * as Sentry from "@sentry/node";
4851

4952
const { logger } = Sentry;
5053

5154
logger.trace("Starting database connection", { database: "users" });
52-
logger.debug("Cache miss for user", { userId: 123 });
55+
logger.debug(logger.fmt`Cache miss for user: ${userId}`);
5356
logger.info("Updated profile", { profileId: 345 });
5457
logger.warn("Rate limit reached for endpoint", {
5558
endpoint: "/api/results/",

platform-includes/llm-rules-logs/javascript.react.mdx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
<Expandable title="Logger Rules for Cursor or Windsurf" copy={true}>
1+
<Expandable title="AI Rules for Logs in Code Editors" copy={true}>
22

3+
When created as a rules file this should be placed alongside other editor specific rule files. For example, if you are using Cursor, place this file in the `.cursorrules` directory.
34

45
````markdown {filename:rules.md}
56

@@ -41,13 +42,15 @@ Sentry.init({
4142

4243
## Logger Examples
4344

45+
`logger.fmt` is a template literal function that should be used to bring variables into the structured logs.
46+
4447
```javascript
4548
import * as Sentry from "@sentry/react";
4649

4750
const { logger } = Sentry;
4851

4952
logger.trace("Starting database connection", { database: "users" });
50-
logger.debug("Cache miss for user", { userId: 123 });
53+
logger.debug(logger.fmt`Cache miss for user: ${userId}`);
5154
logger.info("Updated profile", { profileId: 345 });
5255
logger.warn("Rate limit reached for endpoint", {
5356
endpoint: "/api/results/",

platform-includes/llm-rules-platform/_default.mdx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
<Expandable title="AI Rules for Cursor or Windsurf" copy={true}>
1+
<Expandable title="AI Rules for Code Editors" copy={true}>
22

3-
Sentry provides a set of rules you can use to help your LLM use Sentry correctly. Copy this file and add it to your projects rules configuration.
3+
Sentry provides a set of rules you can use to help your LLM use Sentry correctly. Copy this file and add it to your projects rules configuration. When created as a rules file this should be placed alongside other editor specific rule files. For example, if you are using Cursor, place this file in the `.cursorrules` directory.
44

55
````markdown {filename:rules.md}
66
These examples should be used as guidance when configuring Sentry functionality within a project.
@@ -109,13 +109,15 @@ Sentry.init({
109109

110110
## Logger Examples
111111

112+
`logger.fmt` is a template literal function that should be used to bring variables into the structured logs.
113+
112114
```javascript
113115
import * as Sentry from "@sentry/browser";
114116

115117
const { logger } = Sentry;
116118

117119
logger.trace("Starting database connection", { database: "users" });
118-
logger.debug("Cache miss for user", { userId: 123 });
120+
logger.debug(logger.fmt`Cache miss for user: ${userId}`);
119121
logger.info("Updated profile", { profileId: 345 });
120122
logger.warn("Rate limit reached for endpoint", {
121123
endpoint: "/api/results/",

platform-includes/llm-rules-platform/javascript.nextjs.mdx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
<Expandable title="AI Rules for Cursor or Windsurf" copy={true}>
1+
<Expandable title="AI Rules for Code Editors" copy={true}>
22

3-
Sentry provides a set of rules you can use to help your LLM use Sentry correctly. Copy this file and add it to your projects rules configuration.
3+
Sentry provides a set of rules you can use to help your LLM use Sentry correctly. Copy this file and add it to your projects rules configuration. When created as a rules file this should be placed alongside other editor specific rule files. For example, if you are using Cursor, place this file in the `.cursorrules` directory.
44

55
````markdown {filename:rules.md}
66
These examples should be used as guidance when configuring Sentry functionality within a project.
@@ -112,9 +112,11 @@ Sentry.init({
112112

113113
## Logger Examples
114114

115+
`logger.fmt` is a template literal function that should be used to bring variables into the structured logs.
116+
115117
```javascript
116118
logger.trace("Starting database connection", { database: "users" });
117-
logger.debug("Cache miss for user", { userId: 123 });
119+
logger.debug(logger.fmt`Cache miss for user: ${userId}`);
118120
logger.info("Updated profile", { profileId: 345 });
119121
logger.warn("Rate limit reached for endpoint", {
120122
endpoint: "/api/results/",

platform-includes/llm-rules-platform/javascript.node.mdx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
<Expandable title="AI Rules for Cursor or Windsurf" copy={true}>
1+
<Expandable title="AI Rules for Code Editors" copy={true}>
22

3-
Sentry provides a set of rules you can use to help your LLM use Sentry correctly. Copy this file and add it to your projects rules configuration.
3+
Sentry provides a set of rules you can use to help your LLM use Sentry correctly. Copy this file and add it to your projects rules configuration. When created as a rules file this should be placed alongside other editor specific rule files. For example, if you are using Cursor, place this file in the `.cursorrules` directory.
44

55
````markdown {filename:rules.md}
66
These examples should be used as guidance when configuring Sentry functionality within a project.
@@ -106,9 +106,11 @@ Sentry.init({
106106

107107
## Logger Examples
108108

109+
`logger.fmt` is a template literal function that should be used to bring variables into the structured logs.
110+
109111
```javascript
110112
logger.trace("Starting database connection", { database: "users" });
111-
logger.debug("Cache miss for user", { userId: 123 });
113+
logger.debug(logger.fmt`Cache miss for user: ${userId}`);
112114
logger.info("Updated profile", { profileId: 345 });
113115
logger.warn("Rate limit reached for endpoint", {
114116
endpoint: "/api/results/",

platform-includes/llm-rules-platform/javascript.react.mdx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
<Expandable title="AI Rules for Cursor or Windsurf" copy={true}>
1+
<Expandable title="AI Rules for Code Editors" copy={true}>
22

3-
Sentry provides a set of rules you can use to help your LLM use Sentry correctly. Copy this file and add it to your projects rules configuration.
3+
Sentry provides a set of rules you can use to help your LLM use Sentry correctly. Copy this file and add it to your projects rules configuration. When created as a rules file this should be placed alongside other editor specific rule files. For example, if you are using Cursor, place this file in the `.cursorrules` directory.
44

55
````markdown {filename:rules.md}
66
These examples should be used as guidance when configuring Sentry functionality within a project.
@@ -104,9 +104,11 @@ Sentry.init({
104104

105105
## Logger Examples
106106

107+
`logger.fmt` is a template literal function that should be used to bring variables into the structured logs.
108+
107109
```javascript
108110
logger.trace("Starting database connection", { database: "users" });
109-
logger.debug("Cache miss for user", { userId: 123 });
111+
logger.debug(logger.fmt`Cache miss for user: ${userId}`);
110112
logger.info("Updated profile", { profileId: 345 });
111113
logger.warn("Rate limit reached for endpoint", {
112114
endpoint: "/api/results/",

0 commit comments

Comments
 (0)