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 log events in json #63

Merged
merged 5 commits into from
May 9, 2024
Merged

format log events in json #63

merged 5 commits into from
May 9, 2024

Conversation

ayazabbas
Copy link
Contributor

this now creates logs with the following format:

{
  "text": "2024-05-09 17:06:54.951 | INFO     | pyth_observer.event:send:97 - dv (5ZLaVaVJdvdqGmvnS4jYgJ7k54Kdev7f1q5LDytjwqJ6) price is too far from aggregate price.\n",
  "record": {
    "elapsed": { "repr": "0:01:02.179121", "seconds": 62.179121 },
    "exception": null,
    "extra": {
      "msg": "dv (5ZLaVaVJdvdqGmvnS4jYgJ7k54Kdev7f1q5LDytjwqJ6) price is too far from aggregate price.",
      "type": "PublisherCheck",
      "publisher": "dv (5ZLaVaVJdvdqGmvnS4jYgJ7k54Kdev7f1q5LDytjwqJ6)",
      "symbol": "Crypto.ENJ/USD",
      "publisher_price": "0.31184499 ± 0.00585499",
      "aggregate_price": "0.29085248 ± 0.00217723",
      "deviation": 5.204535302569867
    },
    "file": {
      "name": "event.py",
      "path": "/Users/ayazabbas/dev/pyth/pyth-observer/pyth_observer/event.py"
    },
    "function": "send",
    "level": { "icon": "ℹ️", "name": "INFO", "no": 20 },
    "line": 97,
    "message": "dv (5ZLaVaVJdvdqGmvnS4jYgJ7k54Kdev7f1q5LDytjwqJ6) price is too far from aggregate price.",
    "module": "event",
    "name": "pyth_observer.event",
    "process": { "id": 60108, "name": "MainProcess" },
    "thread": { "id": 8252029632, "name": "MainThread" },
    "time": {
      "repr": "2024-05-09 17:06:54.951338+01:00",
      "timestamp": 1715270814.951338
    }
  }
}

@ayazabbas ayazabbas requested review from thmzlt and cctdaniel May 9, 2024 16:10
@ayazabbas ayazabbas merged commit 74b4a9f into main May 9, 2024
3 checks passed
@ayazabbas ayazabbas deleted the AA_json-log-events branch May 9, 2024 16:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants