diff --git a/DetailedDescription.md b/DetailedDescription.md index 0d8c810..ae046bb 100644 --- a/DetailedDescription.md +++ b/DetailedDescription.md @@ -1,8 +1,12 @@ The purpose of this extension is to group logs visually on AWS CloudWatch. There are three rules: - Set a different background color for each log group of AWS Lambda invocation. Therefore, you can easily recognize beginning, body and end of the logs of the same invocation. -- Set font weight of lines having `REPORT` and `[ERROR]` keywords to bold. +- Set font weight of lines having `REPORT`, `[ERROR]` and `[Error ` keywords to bold. - Set text color of ANSI terminal codes in the logs. (by https://github.com/oguimbal) +Further, there is two functionality for better log viewing experience (by https://github.com/oguimbal): +- Switching to fullscreen, +- Refreshing the logs periodically to load new items. + This extension doesn't collect any user and web page information. It only runs on AWS CloudWatch Logs web page. It is free to use. Overhead is very low, colorize operation takes ~7 milliseconds, listen operation for new event logs takes just ~0.5 milliseconds in every second. @@ -11,9 +15,21 @@ Contributions are welcome. To contribute please visit project page: https://gith Release Log: -------------------- +Version 0.5.1: +- Enable font override on new ui + +Version 0.5.0: +- Handle new ui +- Case insensitive error line search + +Version 0.4.11: +- Add `[Error ` as a special line to make it bold +- Add "Fullscreen" and "Follow tail" buttons + Version 0.3.8: - Set text color of ANSI terminal codes - Update extension logo - Improve performance + Version 0.2.1: -- Make bold font weight of `REPORT` and `[ERROR]` lines +- Make bold font weight of `REPORT` and `[ERROR]` lines \ No newline at end of file diff --git a/README.md b/README.md index 8953b9b..87db7e7 100644 --- a/README.md +++ b/README.md @@ -26,6 +26,7 @@ Contributions are welcome. Please follow the standart.js convention if you want ### Contributors - [@oguimbal](https://github.com/oguimbal) - [@svikrant2014](https://github.com/svikrant2014) +- [@ktwbc](https://github.com/ktwbc) ### Open Source - [ansi_up.js](http://github.com/drudru/ansi_up) \ No newline at end of file diff --git a/colorize.js b/colorize.js index 9bafbd9..fd97968 100644 --- a/colorize.js +++ b/colorize.js @@ -4,13 +4,14 @@ * Contributors: * - Olivier Guimbal, https://github.com/oguimbal * - Vikrant Sharma, https://github.com/svikrant2014 + * - Kris Thom White, https://github.com/ktwbc */ 'use strict' /* global AnsiUp, localStorage */ -const colors = ['#FCA17D', '#F9DBBD', '#ADFFE5', '#FFF399', '#CDC7E5', '#FCD0A1', '#F6A5A2', '#A3F7B5', '#D8B4E2', '#C4F4C7', '#C7FFDA', '#D9FFF8', '#E8E1EF', '#E6DBD0', '#FAFFD8'] +const colors = ["#F9DBBD", "#CDC7E5", "#F6A5A2", "#FFF399", "#C4F4C7", "#E8E1EF", "#D9FFF8", "#ADFFE5", "#E6DBD0", "#C7FFDA", "#FCA17D", "#FCD0A1", "#FAFFD8", "#A3F7B5", "#D8B4E2"] const ansiTransform = new AnsiUp() delete window.AnsiUp // just delete it so its hidden from global space @@ -281,22 +282,7 @@ function refreshAutoRefresh () { function refreshFonts () { const elements = getElements() - const eventIds = Array.from( - new Set( - elements - .filter(isStartOrEnd) - .map(getEventId))) - if (elements && eventIds) { - if (fontsOn()) { - eventIds.forEach(id => elements - .filter(element => hasId(element, id)) - .forEach(element => changeFontElement(element, 'set'))) - } else { - eventIds.forEach(id => elements - .filter(element => hasId(element, id)) - .forEach(element => changeFontElement(element, 'clear'))) - } - } + elements.forEach(element => changeFontElement(element, fontsOn() ? 'set' : 'clear')) } function refreshTail () { @@ -366,7 +352,7 @@ function colorizeElement (element, color) { return element } -function changeFontElement (element, action = undefined) { +function changeFontElement (element, action) { if (element.dataset.isFontHandled !== 'yes' || action) { element.dataset.isFontHandled = 'yes' element.height = '20px' @@ -419,7 +405,7 @@ function getUniqueEventIds (eventIds) { } function changeFontOnGroup (elements) { - elements.forEach(element => changeFontElement(element)) + elements.forEach(changeFontElement) } function colorizeGroup (elements) { @@ -434,17 +420,19 @@ function decorateGroups (elements) { eventIds.forEach( id => { colorizeGroup(elements.filter(element => hasId(element, id))) - if (newDesign && fontsOn()) changeFontOnGroup(elements.filter(element => hasId(element, id))) + if (newDesign && fontsOn()) changeFontOnGroup(elements) }) } } function applyAnsiTransform (e) { - const txt = e.childNodes[0] - const textValue = txt.textContent || '' - if (/(^|\x1b)\[(\d+)m/.test(textValue)) { - e.classList.add('ansiColorized') - e.innerHTML = ansiTransform.ansi_to_html(textValue) + if (e) { + const txt = e.childNodes[0] + const textValue = txt.textContent || '' + if (/(^|\x1b)\[(\d+)m/.test(textValue)) { + e.classList.add('ansiColorized') + e.innerHTML = ansiTransform.ansi_to_html(textValue) + } } } @@ -452,10 +440,7 @@ function colorizeAnsi (elements) { for (let e of elements) { if (e.dataset.isAnsiColorizedHandled !== 'yes') { e.dataset.isAnsiColorizedHandled = 'yes' - if (e.childNodes.length !== 1 || e.childNodes[0].nodeType !== 3) { - continue // expecting only one child text node - } - applyAnsiTransform(e) + applyAnsiTransform(e.getElementsByClassName("logs__log-events-table__cell")[1]) } } } diff --git a/colorize_cloudwatch_logs.zip b/colorize_cloudwatch_logs.zip deleted file mode 100644 index 127fe10..0000000 Binary files a/colorize_cloudwatch_logs.zip and /dev/null differ diff --git a/hello.html b/hello.html index 51cfc74..679e9fe 100644 --- a/hello.html +++ b/hello.html @@ -18,5 +18,6 @@
If you enable "Follow tail", it refreshes the logs periodically to load new items.
This extension doesn't collect any user and web page information. It only runs on AWS CloudWatch Logs web page. It is free to use.
+v0.5.1