Fmt.
This commit is contained in:
parent
b5bb534664
commit
89cedc120a
3 changed files with 4 additions and 7 deletions
|
@ -18,11 +18,11 @@ import queue
|
||||||
from queue import Queue
|
from queue import Queue
|
||||||
import sys
|
import sys
|
||||||
from threading import Event, Lock, Thread
|
from threading import Event, Lock, Thread
|
||||||
from time import sleep as _sleep, time
|
from time import time
|
||||||
|
|
||||||
|
from .cursedlogger import CursesHandler
|
||||||
from .icmp import *
|
from .icmp import *
|
||||||
from .icmp import _ping
|
from .icmp import _ping
|
||||||
from .cursedlogger import CursesHandler
|
|
||||||
|
|
||||||
|
|
||||||
log = logging.getLogger(__name__)
|
log = logging.getLogger(__name__)
|
||||||
|
@ -218,7 +218,7 @@ def main():
|
||||||
logscr = curses.newwin(height, width, begin_y, begin_x)
|
logscr = curses.newwin(height, width, begin_y, begin_x)
|
||||||
|
|
||||||
handler = CursesHandler(logscr)
|
handler = CursesHandler(logscr)
|
||||||
formatter = logging.Formatter('%(asctime)s %(name)-12s %(levelname)-8s %(message)s')
|
formatter = logging.Formatter("%(asctime)s %(name)-12s %(levelname)-8s %(message)s")
|
||||||
handler.setFormatter(formatter)
|
handler.setFormatter(formatter)
|
||||||
log.addHandler(handler)
|
log.addHandler(handler)
|
||||||
log.setLevel(logging.DEBUG)
|
log.setLevel(logging.DEBUG)
|
||||||
|
|
|
@ -1,10 +1,8 @@
|
||||||
"""A CURSES screen targeted log record handler."""
|
"""A CURSES screen targeted log record handler."""
|
||||||
|
|
||||||
import logging
|
|
||||||
import curses
|
|
||||||
|
|
||||||
from collections import deque as ringbuffer
|
from collections import deque as ringbuffer
|
||||||
from itertools import count
|
from itertools import count
|
||||||
|
import logging
|
||||||
|
|
||||||
|
|
||||||
class CursesHandler(logging.Handler):
|
class CursesHandler(logging.Handler):
|
||||||
|
|
|
@ -11,7 +11,6 @@ from time import sleep as _sleep
|
||||||
from icmplib.exceptions import (
|
from icmplib.exceptions import (
|
||||||
ICMPLibError,
|
ICMPLibError,
|
||||||
ICMPSocketError,
|
ICMPSocketError,
|
||||||
TimeoutExceeded,
|
|
||||||
)
|
)
|
||||||
from icmplib.models import (
|
from icmplib.models import (
|
||||||
Hop,
|
Hop,
|
||||||
|
|
Loading…
Reference in a new issue