Skip to content

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 cctdaniel and thmzlt May 9, 2024 16:10
@ayazabbas ayazabbas merged commit 74b4a9f into main May 9, 2024
@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