Blame view

MLTD/src/ReportSyslog.py 496 Bytes
2e20dacc7   Thanasis Naskos   MLTD implementati...
1
2
3
4
5
6
7
8
9
10
11
12
13
  import logging.handlers
  
  def report(asset_id, risk, timeframe):
      my_logger = logging.getLogger('MyLogger')
      my_logger.setLevel(logging.DEBUG)
  
      # handler = logging.FileHandler('mltd.log')
      handler = logging.handlers.SysLogHandler(address='/dev/log')
      handler.ident = 'KEA-MLTD'
      formatter = logging.Formatter(' %(message)s')
      handler.setFormatter(formatter)
      my_logger.addHandler(handler)
      my_logger.critical(f'asset: {asset_id} risk: {risk} timeframe: {timeframe}')