Skip to content
This repository was archived by the owner on Aug 6, 2025. It is now read-only.

Commit 3937e64

Browse files
authored
Add column to formatters
Adding the column to the format in the same way that the line number can be added
1 parent 68bccdb commit 3937e64

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

src/formatter.js

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,24 @@ let _formatLineNumber = function (logEvent) {
106106

107107
};
108108

109+
/**
110+
* @function
111+
* @memberOf formatter
112+
*
113+
* @param {LOG_EVENT} logEvent
114+
*
115+
* @return {string}
116+
*/
117+
let _formatColumn = function (logEvent) {
118+
119+
if (!logEvent.column) {
120+
_getFileDetails(logEvent);
121+
}
122+
123+
return `${logEvent.column}`;
124+
125+
};
126+
109127
/**
110128
* @function
111129
* @memberOf formatter
@@ -230,6 +248,7 @@ let _formatters = {
230248
'F|file' : _formatFile,
231249
'K|map|MAP' : _formatMapMessage,
232250
'L|line' : _formatLineNumber,
251+
'column': _formatColumn,
233252
'm|msg|message' : _formatLogMessage,
234253
'M|method' : _formatMethodName,
235254
'n' : _formatLineSeparator,

0 commit comments

Comments
 (0)