Coder Social home page Coder Social logo

Comments (2)

agusmakmun avatar agusmakmun commented on August 19, 2024

Hmm I see the problem, it because of this:

>>> LOG_VIEWER_PATTERNS = ['\d\d\d\d\d\d\d\dT\d\d\d\d\d\dZ#USR=\d#AU=\d#IU=\d#DVC=\d#AD=\d#PD=\d']
>>> reversed_patterns = [x[::-1] for x in LOG_VIEWER_PATTERNS]
>>> reversed_patterns
['d\\=DP#d\\=DA#d\\=CVD#d\\=UI#d\\=UA#d\\=RSU#Zd\\d\\d\\d\\d\\d\\Td\\d\\d\\d\\d\\d\\d\\d\\']
>>>

your \d is parsed to \\d after reversed.

meanwhile we didn't support yet for complex regex patterns,

if next_char == '\n' and line:
if any([line.endswith(p) for p in reversed_patterns]):
if exclude in line[::-1]:

from django-log-viewer.

irfanhakim-as avatar irfanhakim-as commented on August 19, 2024

Hmm I see the problem, it because of this:

>>> LOG_VIEWER_PATTERNS = ['\d\d\d\d\d\d\d\dT\d\d\d\d\d\dZ#USR=\d#AU=\d#IU=\d#DVC=\d#AD=\d#PD=\d']
>>> reversed_patterns = [x[::-1] for x in LOG_VIEWER_PATTERNS]
>>> reversed_patterns
['d\\=DP#d\\=DA#d\\=CVD#d\\=UI#d\\=UA#d\\=RSU#Zd\\d\\d\\d\\d\\d\\Td\\d\\d\\d\\d\\d\\d\\d\\']
>>>

your \d is parsed to \\d after reversed.

meanwhile we didn't support yet for complex regex patterns,

if next_char == '\n' and line:
if any([line.endswith(p) for p in reversed_patterns]):
if exclude in line[::-1]:

Thanks for coming back. Is a workaround or solution available on how I may achieve to parse that log pattern of mine?

If there isn't, I'd like to exclude that log file entirely and only display other log files of mine that are much easier to parse (with levelname for example). But I'm having an issue with that as well as per #28

from django-log-viewer.

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.