File tree Expand file tree Collapse file tree 7 files changed +28
-14
lines changed
Expand file tree Collapse file tree 7 files changed +28
-14
lines changed Original file line number Diff line number Diff line change 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
4749import * as Sentry from "@sentry/nextjs";
4850
4951const { logger } = Sentry;
5052
5153logger.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}` );
5355logger.info("Updated profile", { profileId: 345 });
5456logger.warn("Rate limit reached for endpoint", {
5557 endpoint: "/api/results/",
Original file line number Diff line number Diff line change 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
4749import * as Sentry from "@sentry/node";
4850
4951const { logger } = Sentry;
5052
5153logger.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}` );
5355logger.info("Updated profile", { profileId: 345 });
5456logger.warn("Rate limit reached for endpoint", {
5557 endpoint: "/api/results/",
Original file line number Diff line number Diff line change 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
4547import * as Sentry from "@sentry/react";
4648
4749const { logger } = Sentry;
4850
4951logger.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}` );
5153logger.info("Updated profile", { profileId: 345 });
5254logger.warn("Rate limit reached for endpoint", {
5355 endpoint: "/api/results/",
Original file line number Diff line number Diff line change 1- <Expandable title = " AI Rules for Cursor or Windsurf " copy = { true } >
1+ <Expandable title = " AI Rules for Code Editors " copy = { true } >
22
33Sentry 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
113115import * as Sentry from "@sentry/browser";
114116
115117const { logger } = Sentry;
116118
117119logger.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}` );
119121logger.info("Updated profile", { profileId: 345 });
120122logger.warn("Rate limit reached for endpoint", {
121123 endpoint: "/api/results/",
Original file line number Diff line number Diff line change 1- <Expandable title = " AI Rules for Cursor or Windsurf " copy = { true } >
1+ <Expandable title = " AI Rules for Code Editors " copy = { true } >
22
33Sentry 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
116118logger.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}` );
118120logger.info("Updated profile", { profileId: 345 });
119121logger.warn("Rate limit reached for endpoint", {
120122 endpoint: "/api/results/",
Original file line number Diff line number Diff line change 1- <Expandable title = " AI Rules for Cursor or Windsurf " copy = { true } >
1+ <Expandable title = " AI Rules for Code Editors " copy = { true } >
22
33Sentry 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
110112logger.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}` );
112114logger.info("Updated profile", { profileId: 345 });
113115logger.warn("Rate limit reached for endpoint", {
114116 endpoint: "/api/results/",
Original file line number Diff line number Diff line change 1- <Expandable title = " AI Rules for Cursor or Windsurf " copy = { true } >
1+ <Expandable title = " AI Rules for Code Editors " copy = { true } >
22
33Sentry 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
108110logger.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}` );
110112logger.info("Updated profile", { profileId: 345 });
111113logger.warn("Rate limit reached for endpoint", {
112114 endpoint: "/api/results/",
You can’t perform that action at this time.
0 commit comments