Use a single log for entire `.clearing` subsys

rekt_pps
Tyler Goodlet 2023-03-22 11:48:35 -04:00
parent 2454dda18f
commit 3bf48ab597
5 changed files with 45 additions and 11 deletions

View File

@ -18,9 +18,12 @@
Market machinery for order executions, book, management.
"""
from ..log import get_logger
from ._client import open_ems
__all__ = [
'open_ems',
]
log = get_logger(__name__)

View File

@ -27,8 +27,10 @@ import trio
import tractor
from tractor.trionics import broadcast_receiver
from ._util import (
log, # sub-sys logger
)
from ..accounting._mktinfo import unpack_fqme
from ..log import get_logger
from ..data.types import Struct
from ..service import maybe_open_emsd
from ._messages import (
@ -44,9 +46,6 @@ if TYPE_CHECKING:
)
log = get_logger(__name__)
class OrderBook(Struct):
'''EMS-client-side order book ctl and tracking.

View File

@ -41,7 +41,9 @@ import trio
from trio_typing import TaskStatus
import tractor
from ..log import get_logger
from ._util import (
log, # sub-sys logger
)
from ..data._normalize import iterticks
from ..accounting._mktinfo import (
unpack_fqme,
@ -68,9 +70,6 @@ from ._messages import (
)
log = get_logger(__name__)
# TODO: numba all of this
def mk_check(

View File

@ -47,7 +47,9 @@ from ..accounting import (
)
from ..data._normalize import iterticks
from ..accounting._mktinfo import unpack_fqme
from ..log import get_logger
from ._util import (
log, # sub-sys logger
)
from ._messages import (
BrokerdCancel,
BrokerdOrder,
@ -58,8 +60,6 @@ from ._messages import (
BrokerdError,
)
log = get_logger(__name__)
class PaperBoi(Struct):
'''

View File

@ -0,0 +1,33 @@
# piker: trading gear for hackers
# Copyright (C) Tyler Goodlet (in stewardship for pikers)
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
"""
Sub-sys module commons.
"""
from functools import partial
from ..log import (
get_logger,
get_console_log,
)
subsys: str = 'piker.clearing'
log = get_logger(subsys)
get_console_log = partial(
get_console_log,
name=subsys,
)