hgext/blackbox.py
changeset 40439 25f1c7bd649d
parent 40295 fa88170c10bb
child 40630 5bd3d6b264c1
--- a/hgext/blackbox.py	Tue Oct 23 14:04:17 2018 -0700
+++ b/hgext/blackbox.py	Wed Oct 17 15:48:01 2018 -0700
@@ -33,6 +33,11 @@
   # rotate up to N log files when the current one gets too big
   maxfiles = 3
 
+  [blackbox]
+  # Include nanoseconds in log entries with %f (see Python function
+  # datetime.datetime.strftime)
+  date-format = '%Y-%m-%d @ %H:%M:%S.%f'
+
 """
 
 from __future__ import absolute_import
@@ -82,6 +87,9 @@
 configitem('blackbox', 'track',
     default=lambda: ['*'],
 )
+configitem('blackbox', 'date-format',
+    default='%Y/%m/%d %H:%M:%S',
+)
 
 lastui = None
 
@@ -169,7 +177,8 @@
                 return
             ui._bbinlog = True
             default = self.configdate('devel', 'default-date')
-            date = dateutil.datestr(default, '%Y/%m/%d %H:%M:%S')
+            date = dateutil.datestr(default,
+                                    ui.config('blackbox', 'date-format'))
             user = procutil.getuser()
             pid = '%d' % procutil.getpid()
             formattedmsg = msg[0] % msg[1:]