betterlog 0.14.1 → 0.15.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ab0bc01e77def4b7820e71cda07c6b5bf818bc4b5d57cb7919ef95a7f1171eab
4
- data.tar.gz: 1cf84a1362cbcb9a50f58c9e6564116583551b6ac8255488610232ead648b3dc
3
+ metadata.gz: 12593a18d28fc916e5c30257103937523a972f44a588087dd929742d99043b37
4
+ data.tar.gz: d0db15ffbe77f7f088c61c073c72a6847a79b07fd9c7f075fa4b8acdfdedaf50
5
5
  SHA512:
6
- metadata.gz: 4806e3547a67f868391d145bac2674439b88e465f00f7d12724a765aa9d55935d18ab2b7e16020cd3517d5bae899202235c8d54ab2c8de1208d405864de79c57
7
- data.tar.gz: 6cba1b114dfa657be363435b00a0d807aa7292852aa173a28727c950dd84d2206f9496673e575c688bd0b1b8a2a53ef8ad8814eaa4760e9e8885c85efe1621a6
6
+ metadata.gz: 7e1b2ff2e6ac4bbe60eefcf48755e143fda9eb122c3392a9cba45e8996df5473903f4bb2a36bb657b1a80acf451215bf377782a33ba447ac61bad5ee7723644f
7
+ data.tar.gz: fca5f361f59320ed444e87f49a620a19b6e9a8d446b1e5c2e8255249915ffbe705787a660cf687c265105c60e24e9768ac427f360b18dafb4b282bf827aa7407
@@ -0,0 +1,60 @@
1
+ version: v1.0
2
+ name: Betterlog pipeline
3
+ agent:
4
+ machine:
5
+ type: e1-standard-2
6
+ os_image: ubuntu1804
7
+
8
+ blocks:
9
+ - name: Caching
10
+ task:
11
+ prologue:
12
+ commands:
13
+ - checkout
14
+ jobs:
15
+ - name: cache bundle
16
+ commands:
17
+ - sem-version ruby 2.7.2
18
+ - cache restore gems-$SEMAPHORE_GIT_BRANCH,gems-master
19
+ - bundle config jobs $(getconf _NPROCESSORS_ONLN)
20
+ - bundle install
21
+ - cache store gems-$SEMAPHORE_GIT_BRANCH vendor/bundle
22
+
23
+ - name: "Unit tests"
24
+ task:
25
+ env_vars:
26
+ - name: RAILS_ENV
27
+ value: test
28
+ prologue:
29
+ commands:
30
+ - checkout
31
+
32
+ # Setup ruby
33
+ - sem-version ruby 2.7.2
34
+
35
+ # Setup gems
36
+ - cache restore gems-$SEMAPHORE_GIT_BRANCH,gems-master
37
+ - bundle config jobs $(getconf _NPROCESSORS_ONLN)
38
+ - bundle install
39
+
40
+ jobs:
41
+ - name: RSpec Unit Tests
42
+ commands:
43
+ - rake
44
+
45
+ - name: Building Docker Image
46
+ task:
47
+
48
+ secrets:
49
+ - name: GCP
50
+
51
+ prologue:
52
+ commands:
53
+ - gcloud auth activate-service-account --key-file=.secrets/gcp.json
54
+ - gcloud auth configure-docker -q
55
+ - checkout
56
+
57
+ jobs:
58
+ - name: Building and pushing
59
+ commands:
60
+ - make build push-latest
data/Dockerfile CHANGED
@@ -1,4 +1,4 @@
1
- FROM alpine:3.12.0 AS builder
1
+ FROM alpine:3.12.1 AS builder
2
2
 
3
3
  # Update/Upgrade/Add packages for building
4
4
 
@@ -16,9 +16,9 @@ RUN make clobber
16
16
 
17
17
  RUN go get -u github.com/betterplace/go-init
18
18
 
19
- RUN make fetch all
19
+ RUN make setup all
20
20
 
21
- FROM alpine:3.12.0 AS runner
21
+ FROM alpine:3.12.1 AS runner
22
22
 
23
23
  # Update/Upgrade/Add packages
24
24
 
data/Makefile CHANGED
@@ -18,7 +18,7 @@ betterlog-server: cmd/betterlog-server/main.go betterlog/*.go
18
18
  local: betterlog-server
19
19
  REDIS_URL=$(REDIS_URL) ./betterlog-server
20
20
 
21
- fetch: fake-package
21
+ setup: fake-package
22
22
  go mod download
23
23
 
24
24
  fake-package:
data/Rakefile CHANGED
@@ -30,6 +30,7 @@ GemHadar do
30
30
  development_dependency 'rake'
31
31
  development_dependency 'rspec'
32
32
  development_dependency 'simplecov'
33
+ development_dependency 'mock_redis'
33
34
  end
34
35
 
35
36
  task :default => :spec
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.14.1
1
+ 0.15.0
@@ -1,22 +1,22 @@
1
1
  # -*- encoding: utf-8 -*-
2
- # stub: betterlog 0.14.1 ruby lib
2
+ # stub: betterlog 0.15.0 ruby lib
3
3
 
4
4
  Gem::Specification.new do |s|
5
5
  s.name = "betterlog".freeze
6
- s.version = "0.14.1"
6
+ s.version = "0.15.0"
7
7
 
8
8
  s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
9
9
  s.require_paths = ["lib".freeze]
10
10
  s.authors = ["betterplace Developers".freeze]
11
- s.date = "2020-08-26"
11
+ s.date = "2020-11-02"
12
12
  s.description = "This library provides structure json logging for our rails projects".freeze
13
13
  s.email = "developers@betterplace.org".freeze
14
14
  s.executables = ["betterlog".freeze, "betterlog_pusher".freeze, "betterlog_sink".freeze]
15
15
  s.extra_rdoc_files = ["README.md".freeze, "lib/betterlog.rb".freeze, "lib/betterlog/global_metadata.rb".freeze, "lib/betterlog/log.rb".freeze, "lib/betterlog/log/event.rb".freeze, "lib/betterlog/log/event_formatter.rb".freeze, "lib/betterlog/log/severity.rb".freeze, "lib/betterlog/log_event_formatter.rb".freeze, "lib/betterlog/logger.rb".freeze, "lib/betterlog/notifiers.rb".freeze, "lib/betterlog/railtie.rb".freeze, "lib/betterlog/version.rb".freeze]
16
- s.files = [".gitignore".freeze, ".travis.yml".freeze, "Dockerfile".freeze, "Gemfile".freeze, "LICENSE".freeze, "Makefile".freeze, "README.md".freeze, "Rakefile".freeze, "TODO.md".freeze, "VERSION".freeze, "betterlog.gemspec".freeze, "betterlog/config.go".freeze, "betterlog/healthz.go".freeze, "betterlog/redis_cert_cache.go".freeze, "bin/betterlog".freeze, "bin/betterlog_pusher".freeze, "bin/betterlog_sink".freeze, "cloudbuild.yaml".freeze, "cmd/betterlog-server/LICENSE".freeze, "cmd/betterlog-server/main.go".freeze, "config/log.yml".freeze, "go.mod".freeze, "go.sum".freeze, "lib/betterlog.rb".freeze, "lib/betterlog/global_metadata.rb".freeze, "lib/betterlog/log.rb".freeze, "lib/betterlog/log/event.rb".freeze, "lib/betterlog/log/event_formatter.rb".freeze, "lib/betterlog/log/severity.rb".freeze, "lib/betterlog/log_event_formatter.rb".freeze, "lib/betterlog/logger.rb".freeze, "lib/betterlog/notifiers.rb".freeze, "lib/betterlog/railtie.rb".freeze, "lib/betterlog/version.rb".freeze, "spec/betterlog/global_metadata_spec.rb".freeze, "spec/betterlog/log/event_spec.rb".freeze, "spec/betterlog/log/severity_spec.rb".freeze, "spec/betterlog/log_spec.rb".freeze, "spec/betterlog/logger_spec.rb".freeze, "spec/spec_helper.rb".freeze]
16
+ s.files = [".gitignore".freeze, ".semaphore/semaphore.yml".freeze, "Dockerfile".freeze, "Gemfile".freeze, "LICENSE".freeze, "Makefile".freeze, "README.md".freeze, "Rakefile".freeze, "TODO.md".freeze, "VERSION".freeze, "betterlog.gemspec".freeze, "betterlog/config.go".freeze, "betterlog/healthz.go".freeze, "betterlog/redis_cert_cache.go".freeze, "bin/betterlog".freeze, "bin/betterlog_pusher".freeze, "bin/betterlog_sink".freeze, "cloudbuild.yaml".freeze, "cmd/betterlog-server/LICENSE".freeze, "cmd/betterlog-server/main.go".freeze, "config/log.yml".freeze, "go.mod".freeze, "go.sum".freeze, "lib/betterlog.rb".freeze, "lib/betterlog/global_metadata.rb".freeze, "lib/betterlog/log.rb".freeze, "lib/betterlog/log/event.rb".freeze, "lib/betterlog/log/event_formatter.rb".freeze, "lib/betterlog/log/severity.rb".freeze, "lib/betterlog/log_event_formatter.rb".freeze, "lib/betterlog/logger.rb".freeze, "lib/betterlog/notifiers.rb".freeze, "lib/betterlog/railtie.rb".freeze, "lib/betterlog/version.rb".freeze, "spec/betterlog/global_metadata_spec.rb".freeze, "spec/betterlog/log/event_spec.rb".freeze, "spec/betterlog/log/severity_spec.rb".freeze, "spec/betterlog/log_spec.rb".freeze, "spec/betterlog/logger_spec.rb".freeze, "spec/spec_helper.rb".freeze]
17
17
  s.homepage = "http://github.com/betterplace/betterlog".freeze
18
18
  s.rdoc_options = ["--title".freeze, "Betterlog".freeze, "--main".freeze, "README.md".freeze]
19
- s.rubygems_version = "3.1.2".freeze
19
+ s.rubygems_version = "3.1.4".freeze
20
20
  s.summary = "Structured logging support for bp".freeze
21
21
  s.test_files = ["spec/betterlog/global_metadata_spec.rb".freeze, "spec/betterlog/log/event_spec.rb".freeze, "spec/betterlog/log/severity_spec.rb".freeze, "spec/betterlog/log_spec.rb".freeze, "spec/betterlog/logger_spec.rb".freeze, "spec/spec_helper.rb".freeze]
22
22
 
@@ -29,6 +29,7 @@ Gem::Specification.new do |s|
29
29
  s.add_development_dependency(%q<rake>.freeze, [">= 0"])
30
30
  s.add_development_dependency(%q<rspec>.freeze, [">= 0"])
31
31
  s.add_development_dependency(%q<simplecov>.freeze, [">= 0"])
32
+ s.add_development_dependency(%q<mock_redis>.freeze, [">= 0"])
32
33
  s.add_runtime_dependency(%q<tins>.freeze, ["~> 1.3", ">= 1.22.0"])
33
34
  s.add_runtime_dependency(%q<complex_config>.freeze, [">= 0"])
34
35
  s.add_runtime_dependency(%q<file-tail>.freeze, ["~> 1.0"])
@@ -42,6 +43,7 @@ Gem::Specification.new do |s|
42
43
  s.add_dependency(%q<rake>.freeze, [">= 0"])
43
44
  s.add_dependency(%q<rspec>.freeze, [">= 0"])
44
45
  s.add_dependency(%q<simplecov>.freeze, [">= 0"])
46
+ s.add_dependency(%q<mock_redis>.freeze, [">= 0"])
45
47
  s.add_dependency(%q<tins>.freeze, ["~> 1.3", ">= 1.22.0"])
46
48
  s.add_dependency(%q<complex_config>.freeze, [">= 0"])
47
49
  s.add_dependency(%q<file-tail>.freeze, ["~> 1.0"])
@@ -1,9 +1,6 @@
1
1
  require 'tins/xt'
2
2
  require 'json'
3
- require 'logger'
4
- require 'time'
5
3
  require 'complex_config'
6
- require 'term/ansicolor'
7
4
 
8
5
  module Betterlog
9
6
  end
@@ -14,7 +11,6 @@ require 'betterlog/global_metadata'
14
11
  require 'betterlog/logger'
15
12
 
16
13
  if defined? Rails
17
- require 'betterlog/log_event_formatter'
18
14
  require 'betterlog/railtie'
19
15
  end
20
16
 
@@ -1,3 +1,6 @@
1
+ require 'time'
2
+ require 'term/ansicolor'
3
+
1
4
  module Betterlog
2
5
  class Log
3
6
  class EventFormatter
@@ -1,3 +1,5 @@
1
+ require 'logger'
2
+
1
3
  module Betterlog
2
4
  class Log
3
5
  class Severity
@@ -1,4 +1,8 @@
1
- require 'redis'
1
+ begin
2
+ require 'redis' unless defined?(Redis)
3
+ rescue LoadError
4
+ end
5
+ require 'logger'
2
6
 
3
7
  module Betterlog
4
8
  class Logger < ::Logger
@@ -1,6 +1,7 @@
1
1
  module Betterlog
2
2
  class Railtie < Rails::Railtie
3
3
  initializer "betterlog_railtie.configure_rails_initialization" do
4
+ require 'betterlog/log_event_formatter'
4
5
  Rails.logger.formatter = Betterlog::LogEventFormatter.new
5
6
  end
6
7
  end
@@ -1,6 +1,6 @@
1
1
  module Betterlog
2
2
  # Betterlog version
3
- VERSION = '0.14.1'
3
+ VERSION = '0.15.0'
4
4
  VERSION_ARRAY = VERSION.split('.').map(&:to_i) # :nodoc:
5
5
  VERSION_MAJOR = VERSION_ARRAY[0] # :nodoc:
6
6
  VERSION_MINOR = VERSION_ARRAY[1] # :nodoc:
@@ -9,5 +9,11 @@ begin
9
9
  require 'byebug'
10
10
  rescue LoadError
11
11
  end
12
+ require 'mock_redis'
13
+ class MockRedis
14
+ class BaseConnectionError < StandardError; end
15
+ class CannotConnectError < BaseConnectionError; end
16
+ end
17
+ Redis=MockRedis
12
18
  require 'betterlog'
13
19
  Betterlog::Log.default_logger = Logger.new(nil)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: betterlog
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.14.1
4
+ version: 0.15.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - betterplace Developers
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-08-26 00:00:00.000000000 Z
11
+ date: 2020-11-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: gem_hadar
@@ -66,6 +66,20 @@ dependencies:
66
66
  - - ">="
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: mock_redis
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
69
83
  - !ruby/object:Gem::Dependency
70
84
  name: tins
71
85
  requirement: !ruby/object:Gem::Requirement
@@ -206,7 +220,7 @@ extra_rdoc_files:
206
220
  - lib/betterlog/version.rb
207
221
  files:
208
222
  - ".gitignore"
209
- - ".travis.yml"
223
+ - ".semaphore/semaphore.yml"
210
224
  - Dockerfile
211
225
  - Gemfile
212
226
  - LICENSE
@@ -267,7 +281,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
267
281
  - !ruby/object:Gem::Version
268
282
  version: '0'
269
283
  requirements: []
270
- rubygems_version: 3.1.2
284
+ rubygems_version: 3.1.4
271
285
  signing_key:
272
286
  specification_version: 4
273
287
  summary: Structured logging support for bp
@@ -1,6 +0,0 @@
1
- rvm:
2
- - 2.6
3
- - 2.7
4
- sudo: false
5
- services:
6
- - redis-server