Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Format is not recognized #185

Open
MrFiregore opened this issue Apr 3, 2024 · 2 comments
Open

Format is not recognized #185

MrFiregore opened this issue Apr 3, 2024 · 2 comments
Labels

Comments

@MrFiregore
Copy link

Pattern:

<State>
  <highlightingPatterns>
    <LogHighlightingPattern enabled="true" pattern="^\s*(e(rror)?|severe)\s*$" captureGroup="-1" action="HIGHLIGHT_LINE" fg="-39836" bold="true" italic="false" stripe="true" uuid="de2d3bb2-78c9-4beb-835e-d483c35c07b6" />
    <LogHighlightingPattern enabled="true" pattern="^\s*w(arn(ing)?)?\s*$" captureGroup="-1" action="HIGHLIGHT_LINE" fg="-6329600" bold="true" italic="false" stripe="false" uuid="11ff1574-2118-4722-905a-61bec89b079e" />
    <LogHighlightingPattern enabled="true" pattern="^\s*i(nfo)?\s*$" captureGroup="-1" action="HIGHLIGHT_LINE" fg="-10316203" bold="false" italic="false" stripe="false" uuid="5e882ebc-2179-488b-8e1a-2fe488636f36" />
  </highlightingPatterns>
  <hiddenSubstrings />
  <parsingPatterns>
    <LogParsingPattern enabled="true" name="JSON" pattern="^\{[\s,]*.*\&quot;level\&quot;\s*:\s*\&quot;(.*?(?&lt;!\\))\&quot;[\s,]*.*\&quot;message\&quot;\s*:\s*\&quot;(.*?(?&lt;!\\))\&quot;[\s,]*.*\&quot;timestamp\&quot;\s*:\s*\&quot;(.*?(?&lt;!\\))\&quot;[\s,]*.*\}$" timePattern="yyyy-MM-dd'T'HH:mm:ss.SSS'Z'" linePattern="^\{" timeId="2" severityId="0" categoryId="1" fullmatch="true" uuid="f73e6ea2-5750-428f-b8db-5a2b8470d6af" />
  </parsingPatterns>
  <settingsVersion>8</settingsVersion>
  <errorStripeModel>heatmap</errorStripeModel>
  <readonlySizeThreshold>16</readonlySizeThreshold>
  <highlight_links>true</highlight_links>
</State>

example log:
{"level":"debug","message":"Unhandled promise:","timestamp":"2024-04-02T22:03:36.679Z"}
{"level":"error","message":"Unhandled promise:","timestamp":"2024-04-02T22:03:36.679Z"}
{"level":"info","message":"Unhandled promise:","timestamp":"2024-04-02T22:03:36.679Z"}
{"level":"warning","message":"Unhandled promise:","timestamp":"2024-04-02T22:03:36.679Z"}
{"level":"debug","message":"Unhandled promise:","timestamp":"2024-04-02T22:03:36.679Z"}
{"level":"debug","message":"Unhandled promise:","timestamp":"2024-04-02T22:03:36.679Z"}
{"level":"debug","message":"Unhandled promise:","timestamp":"2024-04-02T22:03:36.679Z"}
{"level":"debug","message":"Unhandled promise:","timestamp":"2024-04-02T22:03:36.679Z"}
{"level":"debug","message":"Unhandled promise:","timestamp":"2024-04-02T22:03:36.679Z"}
{"level":"debug","message":"Unhandled promise:","timestamp":"2024-04-02T22:03:36.679Z"}
{"level":"debug","message":"Unhandled promise:","timestamp":"2024-04-02T22:03:36.679Z"}
{"level":"debug","message":"Unhandled promise:","timestamp":"2024-04-02T22:03:36.679Z"}
{"level":"debug","message":"Unhandled promise:","timestamp":"2024-04-02T22:03:36.679Z"}

@smirok
Copy link
Contributor

smirok commented Nov 7, 2024

Hi @MrFiregore! Please try it out on the latest Ideolog version.

It works for me:
image

@smirok smirok added the bug label Nov 7, 2024
@DxTea
Copy link

DxTea commented Dec 22, 2024

hi! i'm having the same problem
file.log :
2024-12-22 16:06:13,832 - INFO - text text text
ideologExported.xml:

<State>
  <highlightingPatterns>
    <LogHighlightingPattern enabled="true" pattern="^\s*(e(rror)?|severe)\s*$" captureGroup="-1" action="HIGHLIGHT_LINE" fg="-39836" bold="true" italic="false" stripe="true" uuid="de2d3bb2-78c9-4beb-835e-d483c35c07b6" />
    <LogHighlightingPattern enabled="true" pattern="^\s*w(arn(ing)?)?\s*$" captureGroup="-1" action="HIGHLIGHT_LINE" fg="-6329600" bold="true" italic="false" stripe="false" uuid="11ff1574-2118-4722-905a-61bec89b079e" />
    <LogHighlightingPattern enabled="true" pattern="^\s*i(nfo)?\s*$" captureGroup="-1" action="HIGHLIGHT_LINE" fg="-10316203" bold="false" italic="false" stripe="false" uuid="5e882ebc-2179-488b-8e1a-2fe488636f36" />
  </highlightingPatterns>
  <hiddenSubstrings />
  <parsingPatterns>
    <LogParsingPattern enabled="true" name="Pipe-separated" pattern="^(?s)([^|]*)\|([^|]*)\|([^|]*)\|(.*)$" timePattern="HH:mm:ss.SSS" linePattern="^\d" timeId="0" severityId="1" categoryId="2" fullmatch="false" uuid="b5772998-bf1e-4d9d-ab41-da0b86451163" />
    <LogParsingPattern enabled="true" name="IntelliJ IDEA" pattern="^([^\[]+)(\[[\s\d]+])\s*(\w*)\s*-\s*(\S*)\s*-(.+)$" timePattern="yyyy-MM-dd HH:mm:ss,SSS" linePattern="^\d" timeId="0" severityId="2" categoryId="3" fullmatch="false" uuid="8a0e8992-94cb-4f4c-8be2-42b03609626b" />
    <LogParsingPattern enabled="true" name="TeamCity build log" pattern="^\[([^]]+)](.):\s*(\[[^]]+])?(.*)$" timePattern="HH:mm:ss" linePattern="^\[" timeId="0" severityId="1" categoryId="2" fullmatch="false" uuid="e9fa2755-8390-42f5-a41e-a909c58c8cf9" />
    <LogParsingPattern enabled="true" name="Laravel" pattern="^\[([\d\-: ]*)] [\s\S]*?\.(.*?(?=:)): ([\s\S]*?(?=(^\[[\d\-: ]*])|\Z))$" timePattern="yyyy-MM-dd HH:mm:ss" linePattern="^\[\d" timeId="0" severityId="1" categoryId="-1" fullmatch="true" uuid="9a75fe1c-24f0-4e5d-8359-ce4dbb9c4c33" />
    <LogParsingPattern enabled="true" name="Loguru" pattern="^(\d{4}-\d{2}-\d{2}\s\d{2}:\d{2}:\d{2}\.\d{3}\s)\|(\s[A-Z]*\s*)\|(\s.+:.+:\d+\s-\s.*)$" timePattern="yyyy-MM-dd HH:mm:ss.SSS" linePattern="^\d" timeId="0" severityId="1" categoryId="2" fullmatch="false" uuid="19dd1738-1dc7-4df6-b437-18e0800b7782" />
    <LogParsingPattern enabled="true" name="Logcat" pattern="^(.+)(?:\s+\d*\s+\d*\s+)(V|D|I|W|E)\s([^:]+):(.*)$" timePattern="MM:dd HH:mm:ss.mmm" linePattern="^\d" timeId="0" severityId="1" categoryId="2" fullmatch="false" uuid="b8fcb4d4-b1b8-4681-90f1-42f7c02aaf67" />
    <LogParsingPattern enabled="true" name="Loguru" pattern="^\[([\d\-T:\+\.)]+)\]\s(\w+)\.([A-Z]+):\s(.*)$" timePattern="yyyy-MM-dd'T'HH:mm:ss.SSSSSSXXX" linePattern="^\[" timeId="0" severityId="2" categoryId="1" fullmatch="true" uuid="c1c8800e-b27c-4433-8d4a-3ec5a28f72a9" />
    <LogParsingPattern enabled="true" name="IntelliJ IDEA" pattern="^([^\[]+)(\[[\s\d]+])\s*(\w*)\s*-\s*(\S*)\s*-(.+)$" timePattern="yyyy-MM-dd HH:mm:ss,SSS" linePattern="^\d" timeId="0" severityId="2" categoryId="3" fullmatch="false" uuid="8a0e8992-94cb-4f4c-8be2-42b03609626b" />
  </parsingPatterns>
  <settingsVersion>8</settingsVersion>
  <lastAddedDefaultFormat>b5772998-bf1e-4d9d-ab41-da0b86451163,8a0e8992-94cb-4f4c-8be2-42b03609626b,e9fa2755-8390-42f5-a41e-a909c58c8cf9,9a75fe1c-24f0-4e5d-8359-ce4dbb9c4c33,b8fcb4d4-b1b8-4681-90f1-42f7c02aaf67,19dd1738-1dc7-4df6-b437-18e0800b7782,c1c8800e-b27c-4433-8d4a-3ec5a28f72a9</lastAddedDefaultFormat>
  <errorStripeModel>heatmap</errorStripeModel>
  <readonlySizeThreshold>16</readonlySizeThreshold>
  <highlight_links>true</highlight_links>
</State>

log_config.py :

import logging

logger = logging.getLogger(__name__)
logger.setLevel(logging.INFO)

file_handler = logging.FileHandler('generation.log', mode='w', encoding='utf-8')
file_handler.setLevel(logging.INFO)

console_handler = logging.StreamHandler()
console_handler.setLevel(logging.INFO)

formatter = logging.Formatter('%(asctime)s - %(levelname)s - %(message)s')
file_handler.setFormatter(formatter)
console_handler.setFormatter(formatter)

logger.addHandler(file_handler)
logger.addHandler(console_handler)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants