Clearer logging when developing
Mantenedores costumam responder em até 1 dia
Ninguém assumiu esta issue ainda.
Avaliação
- Dificuldade
- 4/5
- Tempo estimado
- 3-5 dias
- Facilidade para iniciantes
- 35/100
- Tipo de issue
- Funcionalidade
- Clareza
- Razoavelmente clara
- Status de atividade
- Estagnada
- Stack de tecnologia
- react-native, typescript
- Domínio
- developer-experience, observability
Direção de pesquisa
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.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
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;
}
}
- Linguagem predominante
- TypeScript
- Estrelas
- 383
- Forks
- 206
- Merge médio
- 2h 48min
- PRs com merge (30d)
- 3
Preparar o ambiente
- Sem Dockerfile nem arquivo Docker Compose
- Sem modelo de pull request
- Ler o guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de segmentio/analytics-react-native
-
chunk() never resets its size counter: past 500 KB every queued event is uploaded as its own requestAberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 75/100
segmentio/analytics-react-native#1334 · 1 reação ·
Mantenedores costumam responder em até 1 dia
-
Typo in `useSegmentEndpoints` client option in READMETalvez já em andamento @abueide assumiu há 47 dias. Abertabug investigate
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 72/100
segmentio/analytics-react-native#1145 ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 5/5 Mais de uma semana Facilidade para iniciantes 15/100
segmentio/analytics-react-native#1337 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
-
Support react-native-appsflyer 7.x (plugin calls APIs removed in 7.0.0)Talvez já em andamento @andr3wV assumiu há 9 dias. Abertaenhancement
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 68/100
segmentio/analytics-react-native#1328 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
-
`chunk()` returns a sparse array when one event exceeds `maxKB`, stalling the event queue (regression in 2.23.0)Talvez já em andamento @Mohitingale13 assumiu há 49 dias. Abertabug investigate
Dificuldade 3/5 1-2 dias Facilidade para iniciantes 78/100
segmentio/analytics-react-native#1309 ·
Mantenedores costumam responder em até 1 dia
Todas as issues de segmentio/analytics-react-native
Issues semelhantes
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 62/100
umami-software/umami#4637 ·
Mantenedores costumam responder em até 3 dias
-
Hotkeys fire when pressed with the Ctrl key, so browser shortcuts also trigger player actionsTalvez já em andamento @RaphaelFakhri assumiu hoje. Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 75/100
muxinc/media-chrome#1332 ·
Mantenedores costumam responder em até 5 dias
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
polarsource/polar#15580 ·
Mantenedores costumam responder em até 1 dia
-
accepted bug via-triage
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 69/100
pingdotgg/t3code#20931 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
-
bug/1-unconfirmed kind/bug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
Mantenedores costumam responder em até 1 dia