react-native-logs icon indicating copy to clipboard operation
react-native-logs copied to clipboard

Request for a new feature

Open ChDevThinker opened this issue 1 year ago • 1 comments

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 avatar Jun 17 '24 15:06 ChDevThinker

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

ChDevThinker avatar Jun 24 '24 07:06 ChDevThinker

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!

pke avatar Sep 15 '24 21:09 pke

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

alessandro-bottamedi avatar Oct 17 '24 12:10 alessandro-bottamedi

@alessandro-bottamedi @pke

any suggestions on the best way to do this? i tried the __filename and __line method (and it works!) but only at where it is called.

so you like can't wrap it in a function or anything. also it won't give you a full stack trace or anything...

bryanhpchiang avatar Apr 07 '25 18:04 bryanhpchiang