logster 1.3.1 → 1.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (114) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +18 -18
  3. data/.travis.yml +15 -15
  4. data/CHANGELOG.md +140 -137
  5. data/Gemfile +4 -4
  6. data/Guardfile +8 -8
  7. data/LICENSE.txt +22 -22
  8. data/README.md +99 -99
  9. data/Rakefile +24 -24
  10. data/assets/fonts/FontAwesome.otf +0 -0
  11. data/assets/fonts/fontawesome-webfont.eot +0 -0
  12. data/assets/fonts/fontawesome-webfont.svg +639 -639
  13. data/assets/fonts/fontawesome-webfont.ttf +0 -0
  14. data/assets/fonts/fontawesome-webfont.woff +0 -0
  15. data/assets/fonts/fontawesome-webfont.woff2 +0 -0
  16. data/assets/images/Icon-144_rounded.png +0 -0
  17. data/assets/images/Icon-144_square.png +0 -0
  18. data/assets/images/icon_144x144.png +0 -0
  19. data/assets/images/icon_64x64.png +0 -0
  20. data/assets/javascript/client-app.js +92 -81
  21. data/assets/stylesheets/client-app.css +1 -1
  22. data/build_client_app.sh +0 -0
  23. data/client-app/.editorconfig +20 -20
  24. data/client-app/.ember-cli +9 -9
  25. data/client-app/.eslintignore +19 -19
  26. data/client-app/.eslintrc.js +46 -46
  27. data/client-app/.gitignore +23 -23
  28. data/client-app/.travis.yml +27 -27
  29. data/client-app/.watchmanconfig +3 -3
  30. data/client-app/README.md +57 -57
  31. data/client-app/app/app.js +14 -14
  32. data/client-app/app/components/actions-menu.js +37 -0
  33. data/client-app/app/components/message-info.js +65 -18
  34. data/client-app/app/components/message-row.js +45 -45
  35. data/client-app/app/components/panel-resizer.js +75 -75
  36. data/client-app/app/components/tab-contents.js +27 -27
  37. data/client-app/app/components/tab-link.js +5 -5
  38. data/client-app/app/components/tabbed-section.js +32 -32
  39. data/client-app/app/components/time-formatter.js +25 -25
  40. data/client-app/app/components/update-time.js +21 -21
  41. data/client-app/app/controllers/index.js +92 -83
  42. data/client-app/app/controllers/show.js +13 -13
  43. data/client-app/app/index.html +29 -29
  44. data/client-app/app/initializers/app-init.js +72 -55
  45. data/client-app/app/lib/preload.js +14 -14
  46. data/client-app/app/lib/utilities.js +140 -140
  47. data/client-app/app/models/message-collection.js +158 -158
  48. data/client-app/app/models/message.js +99 -99
  49. data/client-app/app/resolver.js +3 -3
  50. data/client-app/app/router.js +14 -14
  51. data/client-app/app/routes/index.js +57 -53
  52. data/client-app/app/routes/show.js +14 -14
  53. data/client-app/app/styles/app.css +497 -387
  54. data/client-app/app/templates/application.hbs +2 -2
  55. data/client-app/app/templates/components/actions-menu.hbs +12 -0
  56. data/client-app/app/templates/components/message-info.hbs +41 -44
  57. data/client-app/app/templates/components/message-row.hbs +17 -17
  58. data/client-app/app/templates/components/panel-resizer.hbs +3 -0
  59. data/client-app/app/templates/components/tabbed-section.hbs +10 -10
  60. data/client-app/app/templates/components/time-formatter.hbs +1 -1
  61. data/client-app/app/templates/index.hbs +65 -57
  62. data/client-app/app/templates/show.hbs +7 -4
  63. data/client-app/config/environment.js +51 -51
  64. data/client-app/config/optional-features.json +3 -3
  65. data/client-app/config/targets.js +18 -18
  66. data/client-app/ember-cli-build.js +29 -29
  67. data/client-app/package-lock.json +11365 -11365
  68. data/client-app/package.json +56 -56
  69. data/client-app/testem.js +25 -25
  70. data/client-app/tests/index.html +34 -34
  71. data/client-app/tests/integration/components/actions-menu-test.js +26 -0
  72. data/client-app/tests/integration/components/message-info-test.js +26 -26
  73. data/client-app/tests/integration/components/message-row-test.js +26 -26
  74. data/client-app/tests/integration/components/panel-resizer-test.js +26 -26
  75. data/client-app/tests/integration/components/tab-contents-test.js +26 -26
  76. data/client-app/tests/integration/components/tab-link-test.js +26 -26
  77. data/client-app/tests/integration/components/tabbed-section-test.js +26 -26
  78. data/client-app/tests/integration/components/time-formatter-test.js +26 -26
  79. data/client-app/tests/integration/components/update-time-test.js +26 -26
  80. data/client-app/tests/test-helper.js +8 -8
  81. data/client-app/tests/unit/controllers/index-test.js +12 -12
  82. data/client-app/tests/unit/controllers/show-test.js +12 -12
  83. data/client-app/tests/unit/initializers/app-init-test.js +31 -31
  84. data/client-app/tests/unit/routes/index-test.js +11 -11
  85. data/client-app/tests/unit/routes/show-test.js +11 -11
  86. data/lib/examples/sidekiq_logster_reporter.rb +21 -21
  87. data/lib/logster.rb +54 -54
  88. data/lib/logster/base_store.rb +130 -130
  89. data/lib/logster/configuration.rb +25 -25
  90. data/lib/logster/ignore_pattern.rb +65 -65
  91. data/lib/logster/logger.rb +108 -108
  92. data/lib/logster/message.rb +227 -227
  93. data/lib/logster/middleware/debug_exceptions.rb +26 -26
  94. data/lib/logster/middleware/reporter.rb +56 -56
  95. data/lib/logster/middleware/viewer.rb +221 -220
  96. data/lib/logster/rails/railtie.rb +58 -58
  97. data/lib/logster/redis_store.rb +481 -481
  98. data/lib/logster/version.rb +3 -3
  99. data/lib/logster/web.rb +14 -14
  100. data/logster.gemspec +34 -34
  101. data/test/examples/test_sidekiq_reporter_example.rb +46 -46
  102. data/test/fake_data/Gemfile +4 -4
  103. data/test/fake_data/generate.rb +10 -10
  104. data/test/logster/middleware/test_reporter.rb +21 -21
  105. data/test/logster/middleware/test_viewer.rb +96 -96
  106. data/test/logster/test_base_store.rb +147 -147
  107. data/test/logster/test_ignore_pattern.rb +41 -41
  108. data/test/logster/test_logger.rb +80 -80
  109. data/test/logster/test_message.rb +34 -34
  110. data/test/logster/test_redis_rate_limiter.rb +230 -230
  111. data/test/logster/test_redis_store.rb +427 -427
  112. data/test/test_helper.rb +38 -38
  113. data/vendor/assets/javascripts/logster.js.erb +39 -39
  114. metadata +6 -2
@@ -1,3 +1,3 @@
1
- {
2
- "ignore_dirs": ["tmp", "dist"]
3
- }
1
+ {
2
+ "ignore_dirs": ["tmp", "dist"]
3
+ }
@@ -1,57 +1,57 @@
1
- # client-app
2
-
3
- This README outlines the details of collaborating on this Ember application.
4
- A short introduction of this app could easily go here.
5
-
6
- ## Prerequisites
7
-
8
- You will need the following things properly installed on your computer.
9
-
10
- * [Git](https://git-scm.com/)
11
- * [Node.js](https://nodejs.org/) (with npm)
12
- * [Ember CLI](https://ember-cli.com/)
13
- * [Google Chrome](https://google.com/chrome/)
14
-
15
- ## Installation
16
-
17
- * `git clone <repository-url>` this repository
18
- * `cd client-app`
19
- * `npm install`
20
-
21
- ## Running / Development
22
-
23
- * `ember serve`
24
- * Visit your app at [http://localhost:4200](http://localhost:4200).
25
- * Visit your tests at [http://localhost:4200/tests](http://localhost:4200/tests).
26
-
27
- ### Code Generators
28
-
29
- Make use of the many generators for code, try `ember help generate` for more details
30
-
31
- ### Running Tests
32
-
33
- * `ember test`
34
- * `ember test --server`
35
-
36
- ### Linting
37
-
38
- * `npm run lint:hbs`
39
- * `npm run lint:js`
40
- * `npm run lint:js -- --fix`
41
-
42
- ### Building
43
-
44
- * `ember build` (development)
45
- * `ember build --environment production` (production)
46
-
47
- ### Deploying
48
-
49
- Specify what it takes to deploy your app.
50
-
51
- ## Further Reading / Useful Links
52
-
53
- * [ember.js](https://emberjs.com/)
54
- * [ember-cli](https://ember-cli.com/)
55
- * Development Browser Extensions
56
- * [ember inspector for chrome](https://chrome.google.com/webstore/detail/ember-inspector/bmdblncegkenkacieihfhpjfppoconhi)
57
- * [ember inspector for firefox](https://addons.mozilla.org/en-US/firefox/addon/ember-inspector/)
1
+ # client-app
2
+
3
+ This README outlines the details of collaborating on this Ember application.
4
+ A short introduction of this app could easily go here.
5
+
6
+ ## Prerequisites
7
+
8
+ You will need the following things properly installed on your computer.
9
+
10
+ * [Git](https://git-scm.com/)
11
+ * [Node.js](https://nodejs.org/) (with npm)
12
+ * [Ember CLI](https://ember-cli.com/)
13
+ * [Google Chrome](https://google.com/chrome/)
14
+
15
+ ## Installation
16
+
17
+ * `git clone <repository-url>` this repository
18
+ * `cd client-app`
19
+ * `npm install`
20
+
21
+ ## Running / Development
22
+
23
+ * `ember serve`
24
+ * Visit your app at [http://localhost:4200](http://localhost:4200).
25
+ * Visit your tests at [http://localhost:4200/tests](http://localhost:4200/tests).
26
+
27
+ ### Code Generators
28
+
29
+ Make use of the many generators for code, try `ember help generate` for more details
30
+
31
+ ### Running Tests
32
+
33
+ * `ember test`
34
+ * `ember test --server`
35
+
36
+ ### Linting
37
+
38
+ * `npm run lint:hbs`
39
+ * `npm run lint:js`
40
+ * `npm run lint:js -- --fix`
41
+
42
+ ### Building
43
+
44
+ * `ember build` (development)
45
+ * `ember build --environment production` (production)
46
+
47
+ ### Deploying
48
+
49
+ Specify what it takes to deploy your app.
50
+
51
+ ## Further Reading / Useful Links
52
+
53
+ * [ember.js](https://emberjs.com/)
54
+ * [ember-cli](https://ember-cli.com/)
55
+ * Development Browser Extensions
56
+ * [ember inspector for chrome](https://chrome.google.com/webstore/detail/ember-inspector/bmdblncegkenkacieihfhpjfppoconhi)
57
+ * [ember inspector for firefox](https://addons.mozilla.org/en-US/firefox/addon/ember-inspector/)
@@ -1,14 +1,14 @@
1
- import Application from '@ember/application';
2
- import Resolver from './resolver';
3
- import loadInitializers from 'ember-load-initializers';
4
- import config from './config/environment';
5
-
6
- const App = Application.extend({
7
- modulePrefix: config.modulePrefix,
8
- podModulePrefix: config.podModulePrefix,
9
- Resolver
10
- });
11
-
12
- loadInitializers(App, config.modulePrefix);
13
-
14
- export default App;
1
+ import Application from "@ember/application";
2
+ import Resolver from "./resolver";
3
+ import loadInitializers from "ember-load-initializers";
4
+ import config from "./config/environment";
5
+
6
+ const App = Application.extend({
7
+ modulePrefix: config.modulePrefix,
8
+ podModulePrefix: config.podModulePrefix,
9
+ Resolver
10
+ });
11
+
12
+ loadInitializers(App, config.modulePrefix);
13
+
14
+ export default App;
@@ -0,0 +1,37 @@
1
+ import Component from "@ember/component";
2
+ import { observer } from "@ember/object";
3
+
4
+ export default Component.extend({
5
+ showMenu: false,
6
+ tagName: "span",
7
+
8
+ init() {
9
+ this._super(...arguments);
10
+ this.bindingFunction = this.bindingFunction.bind(this);
11
+ },
12
+
13
+ bindingFunction(event) {
14
+ const context = this.$()[0];
15
+ if (!Em.$.contains(context, event.target) && context !== event.target) {
16
+ this.set("showMenu", false);
17
+ }
18
+ },
19
+
20
+ bindDocument: observer("showMenu", function() {
21
+ const $document = Em.$(document);
22
+ if (this.get("showMenu")) {
23
+ $document.on("click", this.get("bindingFunction"));
24
+ } else {
25
+ $document.unbind("click", this.get("bindingFunction"));
26
+ }
27
+ }),
28
+
29
+ actions: {
30
+ expandMenu() {
31
+ this.toggleProperty("showMenu");
32
+ },
33
+ share() {
34
+ this.share();
35
+ }
36
+ }
37
+ });
@@ -1,18 +1,65 @@
1
- import Component from "@ember/component";
2
-
3
- export default Component.extend({
4
- actions: {
5
- protect() {
6
- this.get("currentMessage").protect();
7
- },
8
- unprotect() {
9
- this.get("currentMessage").unprotect();
10
- },
11
- remove() {
12
- this.removeMessage(this.get("currentMessage"));
13
- },
14
- solve() {
15
- this.solveMessage(this.get("currentMessage"));
16
- }
17
- }
18
- });
1
+ import Component from "@ember/component";
2
+ import { computed } from "@ember/object";
3
+
4
+ export default Component.extend({
5
+ buttons: computed("currentMessage.{canSolve,protected}", function() {
6
+ const canSolve = this.get("currentMessage.canSolve");
7
+ const protect = this.get("currentMessage.protected");
8
+ const buttons = [];
9
+
10
+ if (!protect && canSolve) {
11
+ buttons.push({
12
+ klass: "solve",
13
+ action: "solve",
14
+ icon: "check-square-o",
15
+ label: "Solve",
16
+ danger: true
17
+ });
18
+ }
19
+
20
+ if (!protect) {
21
+ buttons.push(
22
+ {
23
+ klass: "remove",
24
+ action: "remove",
25
+ icon: "trash-o",
26
+ label: "Remove",
27
+ danger: true
28
+ },
29
+ {
30
+ klass: "protect",
31
+ action: "protect",
32
+ icon: "lock",
33
+ label: "Protect"
34
+ }
35
+ );
36
+ } else {
37
+ buttons.push({
38
+ klass: "unprotect",
39
+ action: "unprotect",
40
+ icon: "unlock",
41
+ label: "Unprotect"
42
+ });
43
+ }
44
+
45
+ return buttons;
46
+ }),
47
+
48
+ actions: {
49
+ protect() {
50
+ this.get("currentMessage").protect();
51
+ },
52
+ unprotect() {
53
+ this.get("currentMessage").unprotect();
54
+ },
55
+ remove() {
56
+ this.removeMessage(this.get("currentMessage"));
57
+ },
58
+ solve() {
59
+ this.solveMessage(this.get("currentMessage"));
60
+ },
61
+ share() {
62
+ window.location.pathname = this.get("currentMessage.shareUrl");
63
+ }
64
+ }
65
+ });
@@ -1,45 +1,45 @@
1
- import Component from "@ember/component";
2
-
3
- let CHECKED_BOTTOM;
4
- let STICK_TO_BOTTOM;
5
-
6
- export default Component.extend({
7
- tagName: "tr",
8
-
9
- classNameBindings: [
10
- "model.rowClass",
11
- ":message-row",
12
- "model.selected:selected"
13
- ],
14
-
15
- click() {
16
- this.selectedMessage(this.get("model"));
17
- },
18
-
19
- willInsertElement() {
20
- if (CHECKED_BOTTOM) {
21
- return;
22
- }
23
-
24
- const $topPanel = Em.$("#top-panel");
25
-
26
- const scrollTop = $topPanel.scrollTop();
27
- const height = $topPanel.height();
28
- const scrollHeight = $topPanel[0].scrollHeight;
29
-
30
- STICK_TO_BOTTOM = scrollHeight - 20 < height + scrollTop;
31
- CHECKED_BOTTOM = true;
32
- },
33
-
34
- didInsertElement: function() {
35
- const $topPanel = Em.$("#top-panel");
36
- Em.run.next(() => {
37
- CHECKED_BOTTOM = false;
38
-
39
- if (STICK_TO_BOTTOM) {
40
- STICK_TO_BOTTOM = false;
41
- $topPanel.scrollTop($topPanel[0].scrollHeight - $topPanel.height());
42
- }
43
- });
44
- }
45
- });
1
+ import Component from "@ember/component";
2
+
3
+ let CHECKED_BOTTOM;
4
+ let STICK_TO_BOTTOM;
5
+
6
+ export default Component.extend({
7
+ tagName: "tr",
8
+
9
+ classNameBindings: [
10
+ "model.rowClass",
11
+ ":message-row",
12
+ "model.selected:selected"
13
+ ],
14
+
15
+ click() {
16
+ this.selectedMessage(this.get("model"));
17
+ },
18
+
19
+ willInsertElement() {
20
+ if (CHECKED_BOTTOM) {
21
+ return;
22
+ }
23
+
24
+ const $topPanel = Em.$("#top-panel");
25
+
26
+ const scrollTop = $topPanel.scrollTop();
27
+ const height = $topPanel.height();
28
+ const scrollHeight = $topPanel[0].scrollHeight;
29
+
30
+ STICK_TO_BOTTOM = scrollHeight - 20 < height + scrollTop;
31
+ CHECKED_BOTTOM = true;
32
+ },
33
+
34
+ didInsertElement() {
35
+ const $topPanel = Em.$("#top-panel");
36
+ Em.run.next(() => {
37
+ CHECKED_BOTTOM = false;
38
+
39
+ if (STICK_TO_BOTTOM) {
40
+ STICK_TO_BOTTOM = false;
41
+ $topPanel.scrollTop($topPanel[0].scrollHeight - $topPanel.height());
42
+ }
43
+ });
44
+ }
45
+ });
@@ -1,75 +1,75 @@
1
- import Component from "@ember/component";
2
-
3
- export default Component.extend({
4
- classNames: ["divider"],
5
-
6
- divideView(fromTop, win) {
7
- const $win = win || Em.$(window);
8
- const height = $win.height();
9
- const fromBottom = $win.height() - fromTop;
10
-
11
- if (fromTop < 100 || fromTop + 100 > height) {
12
- return;
13
- }
14
-
15
- this.topPanel.css("bottom", fromBottom + 5);
16
- this.bottomPanel.css("height", fromBottom - 15);
17
- this.divider.css("bottom", fromBottom - 5);
18
- },
19
-
20
- didInsertElement() {
21
- // inspired by http://plugins.jquery.com/misc/textarea.js
22
- this.topPanel = Em.$("#top-panel");
23
- this.divider = Em.$(".divider");
24
- this.bottomPanel = Em.$("#bottom-panel");
25
-
26
- const $win = Em.$(window);
27
- let resizing = false;
28
-
29
- const performDrag = e => {
30
- if (resizing) {
31
- this.divideView(e.clientY, $win);
32
- }
33
- };
34
-
35
- const endDrag = () => {
36
- Em.$("#overlay").remove();
37
- resizing = false;
38
-
39
- if (localStorage) {
40
- localStorage.logster_divider_bottom = parseInt(
41
- this.divider.css("bottom"),
42
- 10
43
- );
44
- }
45
-
46
- Em.$(document)
47
- .unbind("mousemove", performDrag)
48
- .unbind("mouseup", endDrag);
49
- };
50
-
51
- this.divider
52
- .on("mousedown", () => {
53
- Em.$("<div id='overlay'></div>").appendTo(Em.$("body"));
54
- resizing = true;
55
- Em.$(document)
56
- .mousemove(_.throttle(performDrag, 25))
57
- .mouseup(endDrag);
58
- })
59
- .append(
60
- "<div class='line-1'></div><div class='line-2'></div><div class='line-3'></div>"
61
- );
62
-
63
- Em.run.next(() => {
64
- if (localStorage && localStorage.logster_divider_bottom) {
65
- const fromTop =
66
- $win.height() - parseInt(localStorage.logster_divider_bottom, 10);
67
- this.divideView(fromTop, $win);
68
- }
69
- });
70
- },
71
-
72
- willDestroyElement() {
73
- Em.$(".divider").off("mousedown");
74
- }
75
- });
1
+ import Component from "@ember/component";
2
+ const MOVE_EVENTS = ["touchmove", "mousemove"];
3
+ const UP_EVENTS = ["touchend", "mouseup"];
4
+ const DOWN_EVENTS = ["touchstart", "mousedown"];
5
+
6
+ export default Component.extend({
7
+ classNames: ["divider"],
8
+
9
+ divideView(fromTop, win) {
10
+ const $win = win || Em.$(window);
11
+ const height = $win.height();
12
+ const fromBottom = $win.height() - fromTop;
13
+
14
+ if (fromTop < 100 || fromTop + 170 > height) {
15
+ return;
16
+ }
17
+
18
+ this.divider.css("bottom", fromBottom - 5);
19
+ this.events.trigger("panelResized", fromBottom);
20
+ },
21
+
22
+ didInsertElement() {
23
+ // inspired by http://plugins.jquery.com/misc/textarea.js
24
+ this.divider = Em.$(".divider");
25
+
26
+ const $win = Em.$(window);
27
+ let resizing = false;
28
+
29
+ const performDrag = e => {
30
+ if (resizing) {
31
+ this.divideView(
32
+ e.clientY || (e.touches && e.touches[0] && e.touches[0].clientY),
33
+ $win
34
+ );
35
+ }
36
+ };
37
+
38
+ const endDrag = () => {
39
+ Em.$("#overlay").remove();
40
+ resizing = false;
41
+
42
+ if (localStorage) {
43
+ localStorage.logster_divider_bottom = parseInt(
44
+ this.divider.css("bottom"),
45
+ 10
46
+ );
47
+ }
48
+
49
+ const $document = Em.$(document);
50
+ MOVE_EVENTS.forEach(e => $document.unbind(e, performDrag));
51
+ UP_EVENTS.forEach(e => $document.unbind(e, endDrag));
52
+ };
53
+
54
+ this.divider.on(DOWN_EVENTS.join(" "), e => {
55
+ e.preventDefault(); // for disabling pull-down-to-refresh on mobile
56
+ Em.$("<div id='overlay'></div>").appendTo(Em.$("body"));
57
+ resizing = true;
58
+ Em.$(document)
59
+ .on(MOVE_EVENTS.join(" "), _.throttle(performDrag, 25))
60
+ .on(UP_EVENTS.join(" "), endDrag);
61
+ });
62
+
63
+ Em.run.next(() => {
64
+ if (localStorage && localStorage.logster_divider_bottom) {
65
+ const fromTop =
66
+ $win.height() - parseInt(localStorage.logster_divider_bottom, 10);
67
+ this.divideView(fromTop, $win);
68
+ }
69
+ });
70
+ },
71
+
72
+ willDestroyElement() {
73
+ Em.$(".divider").off(DOWN_EVENTS.join(" "));
74
+ }
75
+ });