Skip to content

Commit 22f5938

Browse files
committed
Renaming to generalize AI editors; adding logger fmt details
1 parent fcae333 commit 22f5938

File tree

7 files changed

+28
-14
lines changed

7 files changed

+28
-14
lines changed

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

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

33

44
````markdown {filename:rules.md}
@@ -43,13 +43,15 @@ Sentry.init({
4343

4444
## Logger Examples
4545

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

4951
const { logger } = Sentry;
5052

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

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

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

33

44
````markdown {filename:rules.md}
@@ -43,13 +43,15 @@ Sentry.init({
4343

4444
## Logger Examples
4545

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

4951
const { logger } = Sentry;
5052

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

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

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

33

44
````markdown {filename:rules.md}
@@ -41,13 +41,15 @@ Sentry.init({
4141

4242
## Logger Examples
4343

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

4749
const { logger } = Sentry;
4850

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

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

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

33
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.
44

@@ -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: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<Expandable title="AI Rules for Cursor or Windsurf" copy={true}>
1+
<Expandable title="AI Rules for Code Editors" copy={true}>
22

33
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.
44

@@ -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: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<Expandable title="AI Rules for Cursor or Windsurf" copy={true}>
1+
<Expandable title="AI Rules for Code Editors" copy={true}>
22

33
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.
44

@@ -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: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<Expandable title="AI Rules for Cursor or Windsurf" copy={true}>
1+
<Expandable title="AI Rules for Code Editors" copy={true}>
22

33
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.
44

@@ -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)