6 var formatterFromFormatString = function(formatString) {
7 return function(record) {
8 var message = formatString
9 .replace('%level', record.level || '-')
10 .replace('%message', record.originalMessage)
11 .replace('%logger', record.loggerName),
13 if(formatString.indexOf('%datetime') !== -1) {
14 currentDate = new Date();
15 message = message.replace('%datetime', + currentDate.getDate() + '-' +
16 (currentDate.getMonth() + 1) + '-' +
17 currentDate.getFullYear() + ' ' +
18 currentDate.getHours() + ':' +
19 currentDate.getMinutes() + ':' +
20 currentDate.getSeconds()
28 fromFormatString: formatterFromFormatString,
29 simple: formatterFromFormatString('[%level] %datetime (%logger) - %message'),
30 noop: formatterFromFormatString('%message')