mowispace / react-native-logs

Performance-aware simple logger for React-Native and Expo with namespaces, custom levels and custom transports (colored console, file writing, etc.)
MIT License
467 stars 33 forks source link

Request for a new feature #99

Closed ChDevThinker closed 1 month ago

ChDevThinker commented 5 months ago

Hello,

I'm using react-native-logs since few months and it's really useful. Thank you. I'm looking for a way to display in logs the name and/or function of the trigger log.

For example, If I put a log in SomeFile.tsx. I would like to see in my log message this : LOG 5:06:39 PM | INFO : SomeFile : my messge.

An other example, if I put a log in myFunction() that is used in SomeFile.tsx. I would like to see in my log message this : LOG 5:06:39 PM | INFO : SomeFile.myFunction() : my messge.

I know that namespaces can help me but, I have to declare it manually and if my code change I have to change the namespaces.

Best regards.

ChDevThinker commented 5 months ago

Hello, It's may be the wrong place to talk about new features ?

pke commented 2 months ago

Can't you use __filename or something like as the namespace and remove the file extension when extending the logger?

@alessandro-bottamedi could you maybe enable discussions here? This this would be Q&A type of discussion and not clutter the issues tracker? Thanks!

alessandro-bottamedi commented 1 month ago

i've open a discussione here: #106 Thanks!