Comments (7)
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.
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.
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.
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.
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.
Haha, I think so!
It works well now, thanks again!
from logview.
Released as part of 0.17.
from logview.
Related Issues (20)
- Support closer-to-ISO-8601 format for timestamps HOT 4
- Commands Not Assigned In read-only-mode HOT 4
- Thank you so much for this package HOT 1
- Simple examples of custom formats and setup HOT 7
- Should not add itself to auto-mode-alist HOT 1
- Auto-reverting does not work over Tramp HOT 1
- Add RFC 5424, ie. syslog levels
- Add submode for standard Python logging module HOT 1
- Add submode for Apache logs
- Add submode for PHP's Monolog
- Auto-Revert mode over Tramp freezes Emacs HOT 6
- Epoch Time Support HOT 4
- guess-submode Option to Search Past 1st Line HOT 8
- [Help] Unable to determine the log format HOT 3
- Can't get entries to be matched HOT 2
- modes derived from logview cannot refine font-lock HOT 9
- Color surrounding portions of log lines HOT 8
- Awesome mode! HOT 1
- Timezone in timestamp HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from logview.