From 50f34810bced3c8e031db1e403561546a1268a93 Mon Sep 17 00:00:00 2001 From: Joshua Boniface Date: Mon, 11 Jun 2018 17:00:09 -0400 Subject: [PATCH] Add millisecond granularity using datetime during output --- ansiiprint.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ansiiprint.py b/ansiiprint.py index c4103c62..5fa9b33b 100644 --- a/ansiiprint.py +++ b/ansiiprint.py @@ -20,7 +20,7 @@ # ############################################################################### -import os, sys, socket, time, libvirt, kazoo.client, threading, fencenode, ansiiprint +import os, sys, socket, time, datetime, libvirt, kazoo.client, threading, fencenode, ansiiprint # ANSII colours for output def red(): @@ -41,7 +41,7 @@ def end(): # Print function def echo(message, prefix, state): # Get the date - date = '{} - '.format(time.strftime('%Y/%m/%d %H:%M:%S')) + date = '{} - '.format(datetime.datetime.now().strftime('%Y/%m/%d %H:%M:%S.%f')) endc = end() # Continuation