*.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
This commit is contained in:
Vadim Yanitskiy 2018-09-30 17:00:25 +07:00
parent 1e3f0aaf6b
commit a275d7a49d
3 changed files with 9 additions and 2 deletions

View File

@ -3,6 +3,8 @@ import mncc_sock
import ctypes import ctypes
import socket import socket
import logging as log
GSM340_PLAN_ISDN = 1 GSM340_PLAN_ISDN = 1
GSM340_TYPE_NATIONAL = 2 GSM340_TYPE_NATIONAL = 2
@ -80,6 +82,9 @@ def send_dtmf(callref):
conn.send_msg(MnccMessageBuilder.build_dtmf_stop(callref, '2')) 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() server = mncc_sock.MnccSocketServer()
conn = server.accept() conn = server.accept()

View File

@ -48,7 +48,8 @@ def sigint_handler(signum, frame):
pykka.ActorRegistry.stop_all() pykka.ActorRegistry.stop_all()
sys.exit(0) 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) signal.signal(signal.SIGINT, sigint_handler)

View File

@ -11,7 +11,8 @@ import smpplib.consts
# to generate some SMS load on OsmoNITB via its SMPP interface # to generate some SMS load on OsmoNITB via its SMPP interface
# if you want to know what's happening # 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): def send_message(dest, string):
parts, encoding_flag, msg_type_flag = smpplib.gsm.make_parts(string) parts, encoding_flag, msg_type_flag = smpplib.gsm.make_parts(string)