Skip to content

Commit 5ba3d87

Browse files
committed
add zerolog to middleware
1 parent 7ff554d commit 5ba3d87

File tree

3 files changed

+23
-9
lines changed

3 files changed

+23
-9
lines changed

docs/platforms/go/guides/zerolog/index.mdx

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,11 +91,20 @@ The sentryzerolog.Options struct has the following fields:
9191

9292

9393
```go
94-
// The log levels to send to Sentry. Default levels are Error, Fatal, and Panic.
94+
// Levels specifies the log levels that will trigger event sending to Sentry.
95+
// Only log messages at these levels will be sent. By default, the levels are
96+
// Error, Fatal, and Panic.
9597
Levels []zerolog.Level
96-
// Enable to add log entries as breadcrumbs in Sentry.
98+
99+
// WithBreadcrumbs, when enabled, adds log entries as breadcrumbs in Sentry.
100+
// Breadcrumbs provide a trail of events leading up to an error, which can
101+
// be invaluable for understanding the context of issues.
97102
WithBreadcrumbs bool
98-
// The timeout duration for flushing events to Sentry.
103+
104+
// FlushTimeout sets the maximum duration allowed for flushing events to Sentry.
105+
// This is the time limit within which all pending events must be sent to Sentry
106+
// before the application exits. A typical use is ensuring all logs are sent before
107+
// application shutdown. The default timeout is usually 3 seconds.
99108
FlushTimeout time.Duration
100109
```
101110

src/components/platformIcon.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -852,6 +852,7 @@ export const PLATFORM_TO_ICON = {
852852
'go-iris': 'iris',
853853
'go-martini': 'martini',
854854
'go-negroni': 'go',
855+
'go-zerolog': 'go',
855856
godot: 'godot',
856857
huggingface: 'huggingface',
857858
java: 'java',
@@ -1040,12 +1041,12 @@ export function PlatformIcon({
10401041

10411042
if (withLanguageIcon && languageIcon !== icon && languageIcon !== 'default') {
10421043
return (
1043-
<div {...otherProps} style={{position: 'relative', ...style}}>
1044+
<div {...otherProps} style={{ position: 'relative', ...style }}>
10441045
<Image
10451046
src={svg}
10461047
width={size}
10471048
height={size}
1048-
style={{borderRadius: `${radius}px`}}
1049+
style={{ borderRadius: `${radius}px` }}
10491050
alt={`${platform} icon`}
10501051
loading="eager"
10511052
/>
@@ -1077,7 +1078,7 @@ export function PlatformIcon({
10771078
{...otherProps}
10781079
placeholder={undefined}
10791080
loading="eager"
1080-
style={{borderRadius: `${radius}px`, marginTop: 0, marginBottom: 0, ...style}}
1081+
style={{ borderRadius: `${radius}px`, marginTop: 0, marginBottom: 0, ...style }}
10811082
alt={`${platform} icon`}
10821083
/>
10831084
);

src/middleware.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import type {NextRequest} from 'next/server';
2-
import {NextResponse} from 'next/server';
1+
import type { NextRequest } from 'next/server';
2+
import { NextResponse } from 'next/server';
33

44
// This env var is set in next.config.js based on the `NEXT_PUBLIC_DEVELOPER_DOCS` env var at build time
55
// a workaround edge middleware not having access to env vars
@@ -27,7 +27,7 @@ const handleRedirects = (request: NextRequest) => {
2727

2828
const redirectTo = redirectMap.get(urlPath);
2929
if (redirectTo) {
30-
return NextResponse.redirect(new URL(redirectTo, request.url), {status: 301});
30+
return NextResponse.redirect(new URL(redirectTo, request.url), { status: 301 });
3131
}
3232

3333
// If we don't find an exact match, we try to look for a :guide placeholder
@@ -225,6 +225,10 @@ const USER_DOCS_REDIRECTS: Redirect[] = [
225225
from: '/platforms/go/negroni/',
226226
to: '/platforms/go/guides/negroni/',
227227
},
228+
{
229+
from: '/platforms/go/zerolog/',
230+
to: '/platforms/go/guides/zerolog/',
231+
},
228232
{
229233
from: '/clients/go/integrations/http/',
230234
to: '/platforms/go/guides/http/',

0 commit comments

Comments
 (0)