Giter VIP home page Giter VIP logo

Comments (7)

doublep avatar doublep commented on May 31, 2024 1

This is currently not possible without major hacks. In principle, I think I could implement something to deal with this too, but maybe you should instead consider tweaking log format, because it currently looks confusing. If you can influence that, of course.

from logview.

doublep avatar doublep commented on May 31, 2024 1

Regexp for the whole entry cannot be specified, because timestamp, level and message are handled specially and I don't want to give users access to this (would mean less flexibility in future). However, it is now possible to specify regexp for certain parts (name, thread and "ignored") in case the automatic one (derived from separators) is not good enough. Regexp must not contain matching groups, but may contain any number of shy groups.

In particular, your example should now be handled by this format (I also added this as a regression test):

    TIMESTAMP IGNORED LEVEL T: <<RX:THREAD:[^-]+>> NAME - MESSAGE

The syntax is pretty verbose, but I chose it that way because it should really not be needed in 99% of cases. Can also be sort of misused for kinda-escaping like this: <<RX:IGNORED:THREAD>> would match literal string "THREAD" and ignore it.

You can wait a couple of days for 0.17, install from MELPA.Unstable or just from GitHub sources. Will close with 0.17.

from logview.

chuxubank avatar chuxubank commented on May 31, 2024

Thanks! This format do looks confusing but there are plenty of old logs we still need to deal with. I will try to modify the log format for new logs.

Maybe we can custom the thread name regexp or even giving an option for users to custom the whole regexp with group to match an entry and provide the group order to match each part?

The other option may let user choose which part is the most greedy part?

Anyway, thanks for your help and this great package!

from logview.

chuxubank avatar chuxubank commented on May 31, 2024
image Thanks for your great help!

I tried the latest MELPA.Unstable but face some issue, with your provided format.
The first two lines work well, but the old line which works before, not matched any more.
Do I need change the formant you provided?

2023-07-19 14:10:02.739 GMT+08:00 DEBUG T: pool-40-thread-1 LottieLockView - starting to play t4.json

from logview.

doublep avatar doublep commented on May 31, 2024

Indeed, I overlooked this. However, this is only because [^-]+ regexp part wouldn't match hyphens, not because of problems in the code itself. I suggest to replace it with .+? then, i.e. "match anything, but don't be greedy". I initially looked at that "-" before the message, but forgot that thread name itself could contain hyphens.

from logview.

chuxubank avatar chuxubank commented on May 31, 2024

Haha, I think so!
It works well now, thanks again!

from logview.

doublep avatar doublep commented on May 31, 2024

Released as part of 0.17.

from logview.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.