Clearer logging when developing
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 35/100
- issue の種類
- 機能追加
- 明瞭さ
- おおむね明確
- 活発さ
- 停滞
- 技術スタック
- react-native, typescript
調査の方向性
No source files or tests are named. Start by locating the configuration and the default event logging path, then compare it with the custom Logger plugin described in the issue. Done means custom event logging can be used without overwriting the logger or disabling unrelated debug and error logs.
索引モデルが issue の本文から書いたものです。
説明
Summary
Our use case:
Visualize all the events in the app from the developer tools console tab. Currently they are quite hard to differentiate
We decided to create a custom plugin since we want to log each event with some nice CSS (Yes, the console supports a limited subset of CSS(!)). But for this implementation it would nice to remove the default logging behaviour of events, but without needing to overwrite the logging instance. I would prefer to have an API or abstraction level where I only work with events.
With our custom plugin we have to disable "debug", but that would probably swallow some imporant logs. We did add a errorHandler though
Proposed Solution
Add a disableDefaultLoggingOfEvents:boolean to the config. Or make it easier to handle events in the Logger
Here is our logger for the curious
/* eslint-disable no-console */
import { PluginType, Plugin } from '@segment/analytics-react-native';
export class LoggerPlugin extends Plugin {
type = PluginType.after;
execute(event: any) {
// This is actually a SegmentEvent, but we use 'any' because its such a pain to make correct
try {
const version = event.context?.protocols?.event_version ?? 1;
const kind = event.type?.toUpperCase() === 'SCREEN' ? 'SCREEN' : 'TRACK';
const tag = `[${kind}V${version}]`;
const name = (event.type === 'screen' ? event.name : event.event) || event.name || 'Unknown Event';
const props = event.properties ?? {};
const tagStyle =
version === 1
? 'background:#0969da;color:#fff;padding:1px 6px;border-radius:999px;font-weight:700'
: 'background:#8250df;color:#fff;padding:1px 6px;border-radius:999px;font-weight:700';
const nameStyle =
'background:rgba(9,105,218,0.18);color:#e6edf3;padding:1px 6px;border-radius:8px;font-weight:800;font-size:12.5px';
const sepStyle = 'color:#8b949e';
console.log(
'%c%s %c%s %c',
tagStyle,
tag,
nameStyle,
name,
sepStyle,
props
);
} catch (error) {
console.error('[LoggerPlugin] Error logging event:', error);
console.log('Event data:', event);
}
return event;
}
}
- 主要言語
- TypeScript
- スター
- 384
- フォーク
- 205
- 平均マージ
- 2時間 48分
- マージ済み PR(30日)
- 3
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
segmentio/analytics-react-native のほかの issue
-
chunk() never resets its size counter: past 500 KB every queued event is uploaded as its own requestオープン
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
segmentio/analytics-react-native#1334 · リアクション 1 件 ·
-
Typo in `useSegmentEndpoints` client option in README対応中かも @abueide が 39 日前に担当しました。 オープンbug investigate
難易度 1/5 1時間未満 初心者へのやさしさ 72/100
segmentio/analytics-react-native#1145 ·
-
難易度 5/5 1週間以上 初心者へのやさしさ 15/100
segmentio/analytics-react-native#1337 ·
-
Support react-native-appsflyer 7.x (plugin calls APIs removed in 7.0.0)対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープンenhancement
難易度 4/5 3〜5日 初心者へのやさしさ 68/100
segmentio/analytics-react-native#1328 · コメント 1 件 ·
-
`chunk()` returns a sparse array when one event exceeds `maxKB`, stalling the event queue (regression in 2.23.0)対応中かも @Mohitingale13 が 41 日前に担当しました。 オープンbug investigate
難易度 3/5 1〜2日 初心者へのやさしさ 78/100
segmentio/analytics-react-native#1309 ·
segmentio/analytics-react-native の issue をすべて見る
似ている issue
-
[Docs] README: FAQ setup command, IDA in the intro, Node badge対応中かも @akram1089 が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
メンテナーはふだん 1 日以内に返信
-
[Feature]: [P3] engine-rs: the package source hash should ignore line endings and untracked filesオープン
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
maniator/verticopolis#880 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
siyuan-note/siyuan#20353 ·
メンテナーはふだん 1 日以内に返信
-
afk-ok area:data-quality importer size:S
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
enorm-labs/event-junkie#3027 ·
メンテナーはふだん 1 日以内に返信