fluent / fluent/fluent-logger-python

FluentRecordFormatter._structuring may raise AttributeError

Aperta
#45 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
Python
Stelle
457
Fork
138
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

`json.loads(str(msg))` may not return a dict, it can return:
- int if `msg` is a json dumped from an int, for example `msg = '123'`
- list if `msg` is a json dumped from a list, for example `msg = '["s", "1"]'`

Only dict have items() method.

So if you get a logger and add a fluent.handler to it, then you execute
`logger.info('1')`
you will get an AttributeError

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Direzione di ricerca

Start at FluentRecordFormatter._structuring and reproduce the failure by attaching a fluent handler, then calling logger.info('1'). Confirm the behavior for JSON scalars and lists, and consider the issue done when these messages no longer raise AttributeError while dictionary messages continue to work.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
python
Ambito
observability
Tipo di issue
Bug
Difficoltà
2/5
Tempo stimato
1-3 ore
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
52/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.