*.py: cosmetic: tweak the global logging format

Printing log level, file name, and line number together with a
log message is the common practice in Osmocom projects that
facilitates debugging and development.

Change-Id: I80cd7cdfa41ae7e70a1890d88c8b2f7357a500af
changes/59/11159/1
Vadim Yanitskiy 4 years ago
parent 1e3f0aaf6b
commit a275d7a49d
  1. 5
      contrib/manual_test_server.py
  2. 3
      mncc_test.py
  3. 3
      smpp_test.py

@ -3,6 +3,8 @@ import mncc_sock
import ctypes
import socket
import logging as log
GSM340_PLAN_ISDN = 1
GSM340_TYPE_NATIONAL = 2
@ -80,6 +82,9 @@ def send_dtmf(callref):
conn.send_msg(MnccMessageBuilder.build_dtmf_stop(callref, '2'))
log.basicConfig(level = log.DEBUG,
format = "%(levelname)s %(filename)s:%(lineno)d %(message)s")
server = mncc_sock.MnccSocketServer()
conn = server.accept()

@ -48,7 +48,8 @@ def sigint_handler(signum, frame):
pykka.ActorRegistry.stop_all()
sys.exit(0)
logging.basicConfig(level=logging.DEBUG)
logging.basicConfig(level = logging.DEBUG,
format = "%(levelname)s %(filename)s:%(lineno)d %(message)s")
signal.signal(signal.SIGINT, sigint_handler)

@ -11,7 +11,8 @@ import smpplib.consts
# to generate some SMS load on OsmoNITB via its SMPP interface
# if you want to know what's happening
logging.basicConfig(level='DEBUG')
logging.basicConfig(level = logging.DEBUG,
format = "%(levelname)s %(filename)s:%(lineno)d %(message)s")
def send_message(dest, string):
parts, encoding_flag, msg_type_flag = smpplib.gsm.make_parts(string)

Loading…
Cancel
Save