tanga_services 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/tanga_services/logger.rb +2 -1
- data/lib/tanga_services/version.rb +1 -1
- data/spec/logger_spec.rb +6 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9e0336d7c56c23350e64ad7260023ec345a4763d
|
4
|
+
data.tar.gz: a253bd98d18ae366de8b88c2d1f21246a6a07068
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e352812754331503464793d104670af037164d8a1d65af3b476611c471c9fb06edf8decaebeac45c70543cb55ffe229f98767ca41c77c0833cd8a1f3b318f7de
|
7
|
+
data.tar.gz: f4e191896a10273d68ce2f7b7243a1dd96b1e5fb94212578203a5a8426d30d370e6cdfbc13907dc11a990ea52bfdba922b6b22f07eb3d9d05b88f8d67e96d11d
|
@@ -10,7 +10,8 @@ module TangaServices
|
|
10
10
|
# TangaServices.logger.error({message: "i crashed"})
|
11
11
|
class Logger < Syslog::Logger
|
12
12
|
def self.application_name=(application_name)
|
13
|
-
|
13
|
+
fail "application name already set" if @logger
|
14
|
+
@logger = Syslog::Logger.new(application_name, Syslog::LOG_LOCAL7)
|
14
15
|
end
|
15
16
|
|
16
17
|
def self.debug(hash)
|
data/spec/logger_spec.rb
CHANGED
@@ -2,7 +2,7 @@ require 'spec_helper'
|
|
2
2
|
|
3
3
|
describe TangaServices do
|
4
4
|
before do
|
5
|
-
# Clears the logging variable
|
5
|
+
# Clears the logging variable, needed cuz mocks and class vars suck..
|
6
6
|
TangaServices::Logger.instance_variable_set(:@logger, nil)
|
7
7
|
end
|
8
8
|
|
@@ -12,6 +12,11 @@ describe TangaServices do
|
|
12
12
|
expect(Syslog::Logger).to receive(:new).with('my_app', Syslog::LOG_LOCAL7).and_return(logger)
|
13
13
|
TangaServices.logger.application_name = 'my_app'
|
14
14
|
end
|
15
|
+
|
16
|
+
it "shouldn't let you set the name twice" do
|
17
|
+
TangaServices.logger.application_name = 'app'
|
18
|
+
expect { TangaServices.logger.application_name = 'app' }.to raise_error
|
19
|
+
end
|
15
20
|
end
|
16
21
|
|
17
22
|
context '.log' do
|