logster 1.3.0 → 1.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +18 -18
- data/.travis.yml +15 -15
- data/CHANGELOG.md +137 -130
- data/Gemfile +4 -4
- data/Guardfile +8 -8
- data/LICENSE.txt +22 -22
- data/README.md +99 -99
- data/Rakefile +24 -24
- data/assets/fonts/FontAwesome.otf +0 -0
- data/assets/fonts/fontawesome-webfont.eot +0 -0
- data/assets/fonts/fontawesome-webfont.svg +639 -639
- data/assets/fonts/fontawesome-webfont.ttf +0 -0
- data/assets/fonts/fontawesome-webfont.woff +0 -0
- data/assets/fonts/fontawesome-webfont.woff2 +0 -0
- data/assets/images/Icon-144_rounded.png +0 -0
- data/assets/images/Icon-144_square.png +0 -0
- data/assets/images/icon_144x144.png +0 -0
- data/assets/images/icon_64x64.png +0 -0
- data/assets/javascript/client-app.js +81 -81
- data/assets/javascript/vendor.js +5302 -5302
- data/assets/stylesheets/client-app.css +0 -0
- data/assets/stylesheets/vendor.css +3 -3
- data/build_client_app.sh +12 -12
- data/client-app/.editorconfig +20 -20
- data/client-app/.ember-cli +9 -9
- data/client-app/.eslintignore +19 -19
- data/client-app/.eslintrc.js +46 -46
- data/client-app/.gitignore +23 -23
- data/client-app/.travis.yml +27 -27
- data/client-app/.watchmanconfig +3 -3
- data/client-app/README.md +57 -57
- data/client-app/app/app.js +14 -14
- data/client-app/app/components/message-info.js +18 -18
- data/client-app/app/components/message-row.js +45 -45
- data/client-app/app/components/panel-resizer.js +75 -75
- data/client-app/app/components/tab-contents.js +27 -27
- data/client-app/app/components/tab-link.js +5 -5
- data/client-app/app/components/tabbed-section.js +32 -32
- data/client-app/app/components/time-formatter.js +25 -25
- data/client-app/app/components/update-time.js +21 -21
- data/client-app/app/controllers/index.js +83 -83
- data/client-app/app/controllers/show.js +13 -13
- data/client-app/app/index.html +29 -29
- data/client-app/app/initializers/app-init.js +55 -55
- data/client-app/app/lib/preload.js +14 -14
- data/client-app/app/lib/utilities.js +140 -140
- data/client-app/app/models/message-collection.js +158 -158
- data/client-app/app/models/message.js +99 -99
- data/client-app/app/resolver.js +3 -3
- data/client-app/app/router.js +14 -14
- data/client-app/app/routes/index.js +53 -53
- data/client-app/app/routes/show.js +14 -14
- data/client-app/app/styles/app.css +387 -387
- data/client-app/app/templates/application.hbs +2 -2
- data/client-app/app/templates/components/message-info.hbs +44 -44
- data/client-app/app/templates/components/message-row.hbs +17 -17
- data/client-app/app/templates/components/tabbed-section.hbs +10 -10
- data/client-app/app/templates/components/time-formatter.hbs +1 -1
- data/client-app/app/templates/index.hbs +57 -57
- data/client-app/app/templates/show.hbs +4 -4
- data/client-app/config/environment.js +51 -51
- data/client-app/config/optional-features.json +3 -3
- data/client-app/config/targets.js +18 -18
- data/client-app/ember-cli-build.js +29 -29
- data/client-app/package-lock.json +11365 -11365
- data/client-app/package.json +56 -56
- data/client-app/testem.js +25 -25
- data/client-app/tests/index.html +34 -34
- data/client-app/tests/integration/components/message-info-test.js +26 -26
- data/client-app/tests/integration/components/message-row-test.js +26 -26
- data/client-app/tests/integration/components/panel-resizer-test.js +26 -26
- data/client-app/tests/integration/components/tab-contents-test.js +26 -26
- data/client-app/tests/integration/components/tab-link-test.js +26 -26
- data/client-app/tests/integration/components/tabbed-section-test.js +26 -26
- data/client-app/tests/integration/components/time-formatter-test.js +26 -26
- data/client-app/tests/integration/components/update-time-test.js +26 -26
- data/client-app/tests/test-helper.js +8 -8
- data/client-app/tests/unit/controllers/index-test.js +12 -12
- data/client-app/tests/unit/controllers/show-test.js +12 -12
- data/client-app/tests/unit/initializers/app-init-test.js +31 -31
- data/client-app/tests/unit/routes/index-test.js +11 -11
- data/client-app/tests/unit/routes/show-test.js +11 -11
- data/lib/examples/sidekiq_logster_reporter.rb +21 -21
- data/lib/logster.rb +54 -54
- data/lib/logster/base_store.rb +130 -130
- data/lib/logster/configuration.rb +25 -25
- data/lib/logster/ignore_pattern.rb +65 -65
- data/lib/logster/logger.rb +108 -102
- data/lib/logster/message.rb +227 -227
- data/lib/logster/middleware/debug_exceptions.rb +26 -26
- data/lib/logster/middleware/reporter.rb +56 -56
- data/lib/logster/middleware/viewer.rb +220 -220
- data/lib/logster/rails/railtie.rb +58 -58
- data/lib/logster/redis_store.rb +481 -481
- data/lib/logster/version.rb +3 -3
- data/lib/logster/web.rb +14 -14
- data/logster.gemspec +34 -34
- data/test/examples/test_sidekiq_reporter_example.rb +46 -46
- data/test/fake_data/Gemfile +4 -4
- data/test/fake_data/generate.rb +10 -10
- data/test/logster/middleware/test_reporter.rb +21 -21
- data/test/logster/middleware/test_viewer.rb +96 -96
- data/test/logster/test_base_store.rb +147 -147
- data/test/logster/test_ignore_pattern.rb +41 -41
- data/test/logster/test_logger.rb +80 -74
- data/test/logster/test_message.rb +34 -34
- data/test/logster/test_redis_rate_limiter.rb +230 -230
- data/test/logster/test_redis_store.rb +427 -427
- data/test/test_helper.rb +38 -38
- data/vendor/assets/javascripts/logster.js.erb +39 -39
- metadata +3 -3
@@ -1,26 +1,26 @@
|
|
1
|
-
import { module, test } from 'qunit';
|
2
|
-
import { setupRenderingTest } from 'ember-qunit';
|
3
|
-
import { render } from '@ember/test-helpers';
|
4
|
-
import hbs from 'htmlbars-inline-precompile';
|
5
|
-
|
6
|
-
module('Integration | Component | tabbed-section', function(hooks) {
|
7
|
-
setupRenderingTest(hooks);
|
8
|
-
|
9
|
-
test('it renders', async function(assert) {
|
10
|
-
// Set any properties with this.set('myProperty', 'value');
|
11
|
-
// Handle any actions with this.set('myAction', function(val) { ... });
|
12
|
-
|
13
|
-
await render(hbs`{{tabbed-section}}`);
|
14
|
-
|
15
|
-
assert.equal(this.element.textContent.trim(), '');
|
16
|
-
|
17
|
-
// Template block usage:
|
18
|
-
await render(hbs`
|
19
|
-
{{#tabbed-section}}
|
20
|
-
template block text
|
21
|
-
{{/tabbed-section}}
|
22
|
-
`);
|
23
|
-
|
24
|
-
assert.equal(this.element.textContent.trim(), 'template block text');
|
25
|
-
});
|
26
|
-
});
|
1
|
+
import { module, test } from 'qunit';
|
2
|
+
import { setupRenderingTest } from 'ember-qunit';
|
3
|
+
import { render } from '@ember/test-helpers';
|
4
|
+
import hbs from 'htmlbars-inline-precompile';
|
5
|
+
|
6
|
+
module('Integration | Component | tabbed-section', function(hooks) {
|
7
|
+
setupRenderingTest(hooks);
|
8
|
+
|
9
|
+
test('it renders', async function(assert) {
|
10
|
+
// Set any properties with this.set('myProperty', 'value');
|
11
|
+
// Handle any actions with this.set('myAction', function(val) { ... });
|
12
|
+
|
13
|
+
await render(hbs`{{tabbed-section}}`);
|
14
|
+
|
15
|
+
assert.equal(this.element.textContent.trim(), '');
|
16
|
+
|
17
|
+
// Template block usage:
|
18
|
+
await render(hbs`
|
19
|
+
{{#tabbed-section}}
|
20
|
+
template block text
|
21
|
+
{{/tabbed-section}}
|
22
|
+
`);
|
23
|
+
|
24
|
+
assert.equal(this.element.textContent.trim(), 'template block text');
|
25
|
+
});
|
26
|
+
});
|
@@ -1,26 +1,26 @@
|
|
1
|
-
import { module, test } from 'qunit';
|
2
|
-
import { setupRenderingTest } from 'ember-qunit';
|
3
|
-
import { render } from '@ember/test-helpers';
|
4
|
-
import hbs from 'htmlbars-inline-precompile';
|
5
|
-
|
6
|
-
module('Integration | Component | time-formatter', function(hooks) {
|
7
|
-
setupRenderingTest(hooks);
|
8
|
-
|
9
|
-
test('it renders', async function(assert) {
|
10
|
-
// Set any properties with this.set('myProperty', 'value');
|
11
|
-
// Handle any actions with this.set('myAction', function(val) { ... });
|
12
|
-
|
13
|
-
await render(hbs`{{time-formatter}}`);
|
14
|
-
|
15
|
-
assert.equal(this.element.textContent.trim(), '');
|
16
|
-
|
17
|
-
// Template block usage:
|
18
|
-
await render(hbs`
|
19
|
-
{{#time-formatter}}
|
20
|
-
template block text
|
21
|
-
{{/time-formatter}}
|
22
|
-
`);
|
23
|
-
|
24
|
-
assert.equal(this.element.textContent.trim(), 'template block text');
|
25
|
-
});
|
26
|
-
});
|
1
|
+
import { module, test } from 'qunit';
|
2
|
+
import { setupRenderingTest } from 'ember-qunit';
|
3
|
+
import { render } from '@ember/test-helpers';
|
4
|
+
import hbs from 'htmlbars-inline-precompile';
|
5
|
+
|
6
|
+
module('Integration | Component | time-formatter', function(hooks) {
|
7
|
+
setupRenderingTest(hooks);
|
8
|
+
|
9
|
+
test('it renders', async function(assert) {
|
10
|
+
// Set any properties with this.set('myProperty', 'value');
|
11
|
+
// Handle any actions with this.set('myAction', function(val) { ... });
|
12
|
+
|
13
|
+
await render(hbs`{{time-formatter}}`);
|
14
|
+
|
15
|
+
assert.equal(this.element.textContent.trim(), '');
|
16
|
+
|
17
|
+
// Template block usage:
|
18
|
+
await render(hbs`
|
19
|
+
{{#time-formatter}}
|
20
|
+
template block text
|
21
|
+
{{/time-formatter}}
|
22
|
+
`);
|
23
|
+
|
24
|
+
assert.equal(this.element.textContent.trim(), 'template block text');
|
25
|
+
});
|
26
|
+
});
|
@@ -1,26 +1,26 @@
|
|
1
|
-
import { module, test } from 'qunit';
|
2
|
-
import { setupRenderingTest } from 'ember-qunit';
|
3
|
-
import { render } from '@ember/test-helpers';
|
4
|
-
import hbs from 'htmlbars-inline-precompile';
|
5
|
-
|
6
|
-
module('Integration | Component | update-time', function(hooks) {
|
7
|
-
setupRenderingTest(hooks);
|
8
|
-
|
9
|
-
test('it renders', async function(assert) {
|
10
|
-
// Set any properties with this.set('myProperty', 'value');
|
11
|
-
// Handle any actions with this.set('myAction', function(val) { ... });
|
12
|
-
|
13
|
-
await render(hbs`{{update-time}}`);
|
14
|
-
|
15
|
-
assert.equal(this.element.textContent.trim(), '');
|
16
|
-
|
17
|
-
// Template block usage:
|
18
|
-
await render(hbs`
|
19
|
-
{{#update-time}}
|
20
|
-
template block text
|
21
|
-
{{/update-time}}
|
22
|
-
`);
|
23
|
-
|
24
|
-
assert.equal(this.element.textContent.trim(), 'template block text');
|
25
|
-
});
|
26
|
-
});
|
1
|
+
import { module, test } from 'qunit';
|
2
|
+
import { setupRenderingTest } from 'ember-qunit';
|
3
|
+
import { render } from '@ember/test-helpers';
|
4
|
+
import hbs from 'htmlbars-inline-precompile';
|
5
|
+
|
6
|
+
module('Integration | Component | update-time', function(hooks) {
|
7
|
+
setupRenderingTest(hooks);
|
8
|
+
|
9
|
+
test('it renders', async function(assert) {
|
10
|
+
// Set any properties with this.set('myProperty', 'value');
|
11
|
+
// Handle any actions with this.set('myAction', function(val) { ... });
|
12
|
+
|
13
|
+
await render(hbs`{{update-time}}`);
|
14
|
+
|
15
|
+
assert.equal(this.element.textContent.trim(), '');
|
16
|
+
|
17
|
+
// Template block usage:
|
18
|
+
await render(hbs`
|
19
|
+
{{#update-time}}
|
20
|
+
template block text
|
21
|
+
{{/update-time}}
|
22
|
+
`);
|
23
|
+
|
24
|
+
assert.equal(this.element.textContent.trim(), 'template block text');
|
25
|
+
});
|
26
|
+
});
|
@@ -1,8 +1,8 @@
|
|
1
|
-
import Application from '../app';
|
2
|
-
import config from '../config/environment';
|
3
|
-
import { setApplication } from '@ember/test-helpers';
|
4
|
-
import { start } from 'ember-qunit';
|
5
|
-
|
6
|
-
setApplication(Application.create(config.APP));
|
7
|
-
|
8
|
-
start();
|
1
|
+
import Application from '../app';
|
2
|
+
import config from '../config/environment';
|
3
|
+
import { setApplication } from '@ember/test-helpers';
|
4
|
+
import { start } from 'ember-qunit';
|
5
|
+
|
6
|
+
setApplication(Application.create(config.APP));
|
7
|
+
|
8
|
+
start();
|
@@ -1,12 +1,12 @@
|
|
1
|
-
import { module, test } from 'qunit';
|
2
|
-
import { setupTest } from 'ember-qunit';
|
3
|
-
|
4
|
-
module('Unit | Controller | index', function(hooks) {
|
5
|
-
setupTest(hooks);
|
6
|
-
|
7
|
-
// Replace this with your real tests.
|
8
|
-
test('it exists', function(assert) {
|
9
|
-
let controller = this.owner.lookup('controller:index');
|
10
|
-
assert.ok(controller);
|
11
|
-
});
|
12
|
-
});
|
1
|
+
import { module, test } from 'qunit';
|
2
|
+
import { setupTest } from 'ember-qunit';
|
3
|
+
|
4
|
+
module('Unit | Controller | index', function(hooks) {
|
5
|
+
setupTest(hooks);
|
6
|
+
|
7
|
+
// Replace this with your real tests.
|
8
|
+
test('it exists', function(assert) {
|
9
|
+
let controller = this.owner.lookup('controller:index');
|
10
|
+
assert.ok(controller);
|
11
|
+
});
|
12
|
+
});
|
@@ -1,12 +1,12 @@
|
|
1
|
-
import { module, test } from 'qunit';
|
2
|
-
import { setupTest } from 'ember-qunit';
|
3
|
-
|
4
|
-
module('Unit | Controller | show', function(hooks) {
|
5
|
-
setupTest(hooks);
|
6
|
-
|
7
|
-
// Replace this with your real tests.
|
8
|
-
test('it exists', function(assert) {
|
9
|
-
let controller = this.owner.lookup('controller:show');
|
10
|
-
assert.ok(controller);
|
11
|
-
});
|
12
|
-
});
|
1
|
+
import { module, test } from 'qunit';
|
2
|
+
import { setupTest } from 'ember-qunit';
|
3
|
+
|
4
|
+
module('Unit | Controller | show', function(hooks) {
|
5
|
+
setupTest(hooks);
|
6
|
+
|
7
|
+
// Replace this with your real tests.
|
8
|
+
test('it exists', function(assert) {
|
9
|
+
let controller = this.owner.lookup('controller:show');
|
10
|
+
assert.ok(controller);
|
11
|
+
});
|
12
|
+
});
|
@@ -1,31 +1,31 @@
|
|
1
|
-
import Application from '@ember/application';
|
2
|
-
|
3
|
-
import { initialize } from 'client-app/initializers/app-init';
|
4
|
-
import { module, test } from 'qunit';
|
5
|
-
import { setupTest } from 'ember-qunit';
|
6
|
-
import { run } from '@ember/runloop';
|
7
|
-
|
8
|
-
module('Unit | Initializer | app-init', function(hooks) {
|
9
|
-
setupTest(hooks);
|
10
|
-
|
11
|
-
hooks.beforeEach(function() {
|
12
|
-
this.TestApplication = Application.extend();
|
13
|
-
this.TestApplication.initializer({
|
14
|
-
name: 'initializer under test',
|
15
|
-
initialize
|
16
|
-
});
|
17
|
-
|
18
|
-
this.application = this.TestApplication.create({ autoboot: false });
|
19
|
-
});
|
20
|
-
|
21
|
-
hooks.afterEach(function() {
|
22
|
-
run(this.application, 'destroy');
|
23
|
-
});
|
24
|
-
|
25
|
-
// Replace this with your real tests.
|
26
|
-
test('it works', async function(assert) {
|
27
|
-
await this.application.boot();
|
28
|
-
|
29
|
-
assert.ok(true);
|
30
|
-
});
|
31
|
-
});
|
1
|
+
import Application from '@ember/application';
|
2
|
+
|
3
|
+
import { initialize } from 'client-app/initializers/app-init';
|
4
|
+
import { module, test } from 'qunit';
|
5
|
+
import { setupTest } from 'ember-qunit';
|
6
|
+
import { run } from '@ember/runloop';
|
7
|
+
|
8
|
+
module('Unit | Initializer | app-init', function(hooks) {
|
9
|
+
setupTest(hooks);
|
10
|
+
|
11
|
+
hooks.beforeEach(function() {
|
12
|
+
this.TestApplication = Application.extend();
|
13
|
+
this.TestApplication.initializer({
|
14
|
+
name: 'initializer under test',
|
15
|
+
initialize
|
16
|
+
});
|
17
|
+
|
18
|
+
this.application = this.TestApplication.create({ autoboot: false });
|
19
|
+
});
|
20
|
+
|
21
|
+
hooks.afterEach(function() {
|
22
|
+
run(this.application, 'destroy');
|
23
|
+
});
|
24
|
+
|
25
|
+
// Replace this with your real tests.
|
26
|
+
test('it works', async function(assert) {
|
27
|
+
await this.application.boot();
|
28
|
+
|
29
|
+
assert.ok(true);
|
30
|
+
});
|
31
|
+
});
|
@@ -1,11 +1,11 @@
|
|
1
|
-
import { module, test } from 'qunit';
|
2
|
-
import { setupTest } from 'ember-qunit';
|
3
|
-
|
4
|
-
module('Unit | Route | index', function(hooks) {
|
5
|
-
setupTest(hooks);
|
6
|
-
|
7
|
-
test('it exists', function(assert) {
|
8
|
-
let route = this.owner.lookup('route:index');
|
9
|
-
assert.ok(route);
|
10
|
-
});
|
11
|
-
});
|
1
|
+
import { module, test } from 'qunit';
|
2
|
+
import { setupTest } from 'ember-qunit';
|
3
|
+
|
4
|
+
module('Unit | Route | index', function(hooks) {
|
5
|
+
setupTest(hooks);
|
6
|
+
|
7
|
+
test('it exists', function(assert) {
|
8
|
+
let route = this.owner.lookup('route:index');
|
9
|
+
assert.ok(route);
|
10
|
+
});
|
11
|
+
});
|
@@ -1,11 +1,11 @@
|
|
1
|
-
import { module, test } from 'qunit';
|
2
|
-
import { setupTest } from 'ember-qunit';
|
3
|
-
|
4
|
-
module('Unit | Route | show', function(hooks) {
|
5
|
-
setupTest(hooks);
|
6
|
-
|
7
|
-
test('it exists', function(assert) {
|
8
|
-
let route = this.owner.lookup('route:show');
|
9
|
-
assert.ok(route);
|
10
|
-
});
|
11
|
-
});
|
1
|
+
import { module, test } from 'qunit';
|
2
|
+
import { setupTest } from 'ember-qunit';
|
3
|
+
|
4
|
+
module('Unit | Route | show', function(hooks) {
|
5
|
+
setupTest(hooks);
|
6
|
+
|
7
|
+
test('it exists', function(assert) {
|
8
|
+
let route = this.owner.lookup('route:show');
|
9
|
+
assert.ok(route);
|
10
|
+
});
|
11
|
+
});
|
@@ -1,21 +1,21 @@
|
|
1
|
-
class SidekiqLogsterReporter
|
2
|
-
def call(ex, context={})
|
3
|
-
# Pass context to Logster
|
4
|
-
fake_env = {}
|
5
|
-
context.each do |key, value|
|
6
|
-
Logster.add_to_env(fake_env, key, value)
|
7
|
-
end
|
8
|
-
|
9
|
-
text = "Job exception: #{ex}\n"
|
10
|
-
if ex.backtrace
|
11
|
-
Logster.add_to_env(fake_env, :backtrace, ex.backtrace)
|
12
|
-
end
|
13
|
-
|
14
|
-
Thread.current[Logster::Logger::LOGSTER_ENV] = fake_env
|
15
|
-
Logster.logger.error(text)
|
16
|
-
rescue => e
|
17
|
-
Logster.logger.fatal("Failed to log exception #{ex} #{hash}\nReason: #{e.class} #{e}\n#{e.backtrace.join("\n")}")
|
18
|
-
ensure
|
19
|
-
Thread.current[Logster::Logger::LOGSTER_ENV] = nil
|
20
|
-
end
|
21
|
-
end
|
1
|
+
class SidekiqLogsterReporter
|
2
|
+
def call(ex, context={})
|
3
|
+
# Pass context to Logster
|
4
|
+
fake_env = {}
|
5
|
+
context.each do |key, value|
|
6
|
+
Logster.add_to_env(fake_env, key, value)
|
7
|
+
end
|
8
|
+
|
9
|
+
text = "Job exception: #{ex}\n"
|
10
|
+
if ex.backtrace
|
11
|
+
Logster.add_to_env(fake_env, :backtrace, ex.backtrace)
|
12
|
+
end
|
13
|
+
|
14
|
+
Thread.current[Logster::Logger::LOGSTER_ENV] = fake_env
|
15
|
+
Logster.logger.error(text)
|
16
|
+
rescue => e
|
17
|
+
Logster.logger.fatal("Failed to log exception #{ex} #{hash}\nReason: #{e.class} #{e}\n#{e.backtrace.join("\n")}")
|
18
|
+
ensure
|
19
|
+
Thread.current[Logster::Logger::LOGSTER_ENV] = nil
|
20
|
+
end
|
21
|
+
end
|
data/lib/logster.rb
CHANGED
@@ -1,54 +1,54 @@
|
|
1
|
-
require 'logster/logger'
|
2
|
-
require 'logster/message'
|
3
|
-
require 'logster/configuration'
|
4
|
-
require 'logster/web'
|
5
|
-
require 'logster/ignore_pattern'
|
6
|
-
|
7
|
-
if defined? Redis
|
8
|
-
require 'logster/redis_store'
|
9
|
-
else
|
10
|
-
STDERR.puts "ERROR: Redis is not loaded, ensure redis gem is required before logster"
|
11
|
-
exit
|
12
|
-
end
|
13
|
-
|
14
|
-
module Logster
|
15
|
-
def self.logger=(logger)
|
16
|
-
@logger = logger
|
17
|
-
end
|
18
|
-
|
19
|
-
def self.logger
|
20
|
-
@logger
|
21
|
-
end
|
22
|
-
|
23
|
-
def self.store=(store)
|
24
|
-
@store=store
|
25
|
-
end
|
26
|
-
|
27
|
-
def self.store
|
28
|
-
@store
|
29
|
-
end
|
30
|
-
|
31
|
-
def self.config=(config)
|
32
|
-
@config = config
|
33
|
-
end
|
34
|
-
|
35
|
-
def self.config
|
36
|
-
@config ||= Configuration.new
|
37
|
-
end
|
38
|
-
|
39
|
-
def self.add_to_env(env, key, value)
|
40
|
-
logster_env = Logster::Message.populate_from_env(env)
|
41
|
-
logster_env[key] = value
|
42
|
-
end
|
43
|
-
|
44
|
-
def self.set_environments(envs)
|
45
|
-
config.environments = envs
|
46
|
-
end
|
47
|
-
end
|
48
|
-
|
49
|
-
# check logster/configuration.rb for config options
|
50
|
-
# Logster.config.environments << :staging
|
51
|
-
|
52
|
-
if defined?(::Rails) && ::Rails::VERSION::MAJOR.to_i >= 3
|
53
|
-
require 'logster/rails/railtie'
|
54
|
-
end
|
1
|
+
require 'logster/logger'
|
2
|
+
require 'logster/message'
|
3
|
+
require 'logster/configuration'
|
4
|
+
require 'logster/web'
|
5
|
+
require 'logster/ignore_pattern'
|
6
|
+
|
7
|
+
if defined? Redis
|
8
|
+
require 'logster/redis_store'
|
9
|
+
else
|
10
|
+
STDERR.puts "ERROR: Redis is not loaded, ensure redis gem is required before logster"
|
11
|
+
exit
|
12
|
+
end
|
13
|
+
|
14
|
+
module Logster
|
15
|
+
def self.logger=(logger)
|
16
|
+
@logger = logger
|
17
|
+
end
|
18
|
+
|
19
|
+
def self.logger
|
20
|
+
@logger
|
21
|
+
end
|
22
|
+
|
23
|
+
def self.store=(store)
|
24
|
+
@store=store
|
25
|
+
end
|
26
|
+
|
27
|
+
def self.store
|
28
|
+
@store
|
29
|
+
end
|
30
|
+
|
31
|
+
def self.config=(config)
|
32
|
+
@config = config
|
33
|
+
end
|
34
|
+
|
35
|
+
def self.config
|
36
|
+
@config ||= Configuration.new
|
37
|
+
end
|
38
|
+
|
39
|
+
def self.add_to_env(env, key, value)
|
40
|
+
logster_env = Logster::Message.populate_from_env(env)
|
41
|
+
logster_env[key] = value
|
42
|
+
end
|
43
|
+
|
44
|
+
def self.set_environments(envs)
|
45
|
+
config.environments = envs
|
46
|
+
end
|
47
|
+
end
|
48
|
+
|
49
|
+
# check logster/configuration.rb for config options
|
50
|
+
# Logster.config.environments << :staging
|
51
|
+
|
52
|
+
if defined?(::Rails) && ::Rails::VERSION::MAJOR.to_i >= 3
|
53
|
+
require 'logster/rails/railtie'
|
54
|
+
end
|