##// END OF EJS Templates
blackbox: add configitem for format of log timestamps...
Matt DeVore -
r40466:25f1c7bd default
parent child Browse files
Show More
@@ -33,6 +33,11 b' Examples::'
33 # rotate up to N log files when the current one gets too big
33 # rotate up to N log files when the current one gets too big
34 maxfiles = 3
34 maxfiles = 3
35
35
36 [blackbox]
37 # Include nanoseconds in log entries with %f (see Python function
38 # datetime.datetime.strftime)
39 date-format = '%Y-%m-%d @ %H:%M:%S.%f'
40
36 """
41 """
37
42
38 from __future__ import absolute_import
43 from __future__ import absolute_import
@@ -82,6 +87,9 b" configitem('blackbox', 'maxfiles',"
82 configitem('blackbox', 'track',
87 configitem('blackbox', 'track',
83 default=lambda: ['*'],
88 default=lambda: ['*'],
84 )
89 )
90 configitem('blackbox', 'date-format',
91 default='%Y/%m/%d %H:%M:%S',
92 )
85
93
86 lastui = None
94 lastui = None
87
95
@@ -169,7 +177,8 b' def wrapui(ui):'
169 return
177 return
170 ui._bbinlog = True
178 ui._bbinlog = True
171 default = self.configdate('devel', 'default-date')
179 default = self.configdate('devel', 'default-date')
172 date = dateutil.datestr(default, '%Y/%m/%d %H:%M:%S')
180 date = dateutil.datestr(default,
181 ui.config('blackbox', 'date-format'))
173 user = procutil.getuser()
182 user = procutil.getuser()
174 pid = '%d' % procutil.getpid()
183 pid = '%d' % procutil.getpid()
175 formattedmsg = msg[0] % msg[1:]
184 formattedmsg = msg[0] % msg[1:]
@@ -82,6 +82,16 b' recursive aliases work correctly'
82 1970/01/01 00:00:00 bob @0000000000000000000000000000000000000000 (5000)> so-confusing exited 0 after * seconds (glob)
82 1970/01/01 00:00:00 bob @0000000000000000000000000000000000000000 (5000)> so-confusing exited 0 after * seconds (glob)
83 1970/01/01 00:00:00 bob @0000000000000000000000000000000000000000 (5000)> blackbox
83 1970/01/01 00:00:00 bob @0000000000000000000000000000000000000000 (5000)> blackbox
84
84
85 custom date format
86 $ rm ./.hg/blackbox.log
87 $ hg --config blackbox.date-format='%Y-%m-%d @ %H:%M:%S' \
88 > --config devel.default-date='1334347993 0' --traceback status
89 A a
90 $ hg blackbox
91 2012-04-13 @ 20:13:13 bob @0000000000000000000000000000000000000000 (5000)> --config 'blackbox.date-format=%Y-%m-%d @ %H:%M:%S' --config 'devel.default-date=1334347993 0' --traceback status
92 2012-04-13 @ 20:13:13 bob @0000000000000000000000000000000000000000 (5000)> --config 'blackbox.date-format=%Y-%m-%d @ %H:%M:%S' --config 'devel.default-date=1334347993 0' --traceback status exited 0 after * seconds (glob)
93 1970/01/01 00:00:00 bob @0000000000000000000000000000000000000000 (5000)> blackbox
94
85 incoming change tracking
95 incoming change tracking
86
96
87 create two heads to verify that we only see one change in the log later
97 create two heads to verify that we only see one change in the log later
General Comments 0
You need to be logged in to leave comments. Login now