equal
deleted
inserted
replaced
31 # limit the size of a log file |
31 # limit the size of a log file |
32 maxsize = 1.5 MB |
32 maxsize = 1.5 MB |
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 |
39 |
44 |
40 import errno |
45 import errno |
79 configitem('blackbox', 'maxfiles', |
84 configitem('blackbox', 'maxfiles', |
80 default=7, |
85 default=7, |
81 ) |
86 ) |
82 configitem('blackbox', 'track', |
87 configitem('blackbox', 'track', |
83 default=lambda: ['*'], |
88 default=lambda: ['*'], |
|
89 ) |
|
90 configitem('blackbox', 'date-format', |
|
91 default='%Y/%m/%d %H:%M:%S', |
84 ) |
92 ) |
85 |
93 |
86 lastui = None |
94 lastui = None |
87 |
95 |
88 def _openlogfile(ui, vfs): |
96 def _openlogfile(ui, vfs): |
167 if getattr(ui, '_bbinlog', False): |
175 if getattr(ui, '_bbinlog', False): |
168 # recursion and failure guard |
176 # recursion and failure guard |
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:] |
176 rev = '(unknown)' |
185 rev = '(unknown)' |
177 changed = '' |
186 changed = '' |