bitcoinwatcher 2.6.1__py3-none-any.whl → 2.7__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,7 @@
1
1
  import logging
2
2
  from contextvars import ContextVar
3
3
  from datetime import datetime
4
+ import colorlog
4
5
 
5
6
  import pytz
6
7
 
@@ -8,9 +9,9 @@ logger = logging.getLogger(__name__)
8
9
  root = logging.getLogger()
9
10
  root.setLevel(logging.INFO)
10
11
 
11
- class TimezoneFormatter(logging.Formatter):
12
- def __init__(self, fmt=None, datefmt=None, tz=None):
13
- super().__init__(fmt, datefmt)
12
+ class TimezoneFormatter(colorlog.ColoredFormatter):
13
+ def __init__(self, fmt=None, datefmt=None, tz=None, log_colors=None):
14
+ super().__init__(fmt, datefmt, log_colors=log_colors)
14
15
  self.tz = tz
15
16
 
16
17
  def formatTime(self, record, datefmt=None):
@@ -19,13 +20,19 @@ class TimezoneFormatter(logging.Formatter):
19
20
  s = dt.strftime(datefmt)
20
21
  else:
21
22
  s = dt.isoformat()
22
- return s
23
-
23
+ return f"\033[94m{s}\033[0m" # Adding blue color to the date
24
24
 
25
25
  formatter = TimezoneFormatter(
26
- ' %(asctime)s %(levelname)s txid=%(tx_id)s tx_status=%(tx_status)s [%(module)s:%(lineno)d] %(funcName)s: %(message)s',
26
+ ' %(asctime)s %(log_color)s%(levelname)s txid=%(tx_id)s tx_status=%(tx_status)s [%(module)s:%(lineno)d] %(message)s',
27
27
  datefmt='%Y-%m-%d %H:%M:%S',
28
- tz=pytz.timezone('Asia/Kolkata')
28
+ tz=pytz.timezone('Asia/Kolkata'),
29
+ log_colors={
30
+ 'DEBUG': 'cyan',
31
+ 'INFO': 'green',
32
+ 'WARNING': 'yellow',
33
+ 'ERROR': 'red',
34
+ 'CRITICAL': 'bold_red',
35
+ }
29
36
  )
30
37
 
31
38
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: bitcoinwatcher
3
- Version: 2.6.1
3
+ Version: 2.7
4
4
  Summary: bitcoinwatcher is a Python library that implements a ZMQ subscriber and provides abstractions to build custom address watchers. This library is designed to make it easy for developers to monitor Bitcoin addresses and react to changes in their state.
5
5
  Author: twosatsmaxi
6
6
  License: Apache License
@@ -229,6 +229,7 @@ Requires-Dist: ordipool==1.2.0
229
229
  Requires-Dist: pyzmq==25.1.2
230
230
  Requires-Dist: python-bitcoinrpc==1.0
231
231
  Requires-Dist: pytz~=2024.2
232
+ Requires-Dist: colorlog~=6.9.0
232
233
 
233
234
  # bitcoinwatcher
234
235
 
@@ -23,10 +23,10 @@ bitcoin/utils/benchmark.py,sha256=HXZy9vU34MKrBoVjx3y982TFEOuSmOz5HWf5LcFwaZA,81
23
23
  bitcoin/utils/bitcoin_rpc.py,sha256=wyTIahgdSyiR1ryPi75n33ERuKQK630YTO9hNs_MML4,1358
24
24
  bitcoin/utils/bitcoin_utils.py,sha256=mrnRPqUa2U2EMKu7rrPV_bW1sL2CJUfbAom0Zdamydk,631
25
25
  bitcoin/utils/constants.py,sha256=irZLlArgica2VckyckEYxH5D5KjvdF52dtBMWswqw8k,52
26
- bitcoin/utils/context_aware_logging.py,sha256=JpTYU9FiNgrTw60cFfGNDy00Icx2x5-Zod4KOJJ6pWU,1579
26
+ bitcoin/utils/context_aware_logging.py,sha256=dGpJvGFghpiZeAnWBnZOvsAfsgLtlAEo3cBl6U7FEO4,1853
27
27
  bitcoin/utils/inscription_utils.py,sha256=8QbOJ1o1n1bMFsPREGLzwFjnGzfuARgJCPr6ORhP44o,193
28
- bitcoinwatcher-2.6.1.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
29
- bitcoinwatcher-2.6.1.dist-info/METADATA,sha256=1FkBp83yL2hZa5byNPkV8gYa3KwFhOcNQOlkJns4ZUc,14991
30
- bitcoinwatcher-2.6.1.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
31
- bitcoinwatcher-2.6.1.dist-info/top_level.txt,sha256=YdUgzLdCiMlrwaKyDqHA1acEd23QFko5bv7D6nBANJ0,8
32
- bitcoinwatcher-2.6.1.dist-info/RECORD,,
28
+ bitcoinwatcher-2.7.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
29
+ bitcoinwatcher-2.7.dist-info/METADATA,sha256=R7vQzGrbi_uUkTj_DtJ8MLEsHXFd4AV6Dq8gTKTMJ2E,15020
30
+ bitcoinwatcher-2.7.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
31
+ bitcoinwatcher-2.7.dist-info/top_level.txt,sha256=YdUgzLdCiMlrwaKyDqHA1acEd23QFko5bv7D6nBANJ0,8
32
+ bitcoinwatcher-2.7.dist-info/RECORD,,