loggerx 0.2.0 → 0.3.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: ef752536a65e45147353b942c929a06694dbe744ab5482ad9eb51eed26e9a739
4
- data.tar.gz: 53f9e598326aa28f1ab8abdd06434c1f268863d9e77d7096c1552fdcb5138b87
3
+ metadata.gz: c3d670b6073866d77bce705fbfee4766ec35a56efa25915c1640bacc6752ef76
4
+ data.tar.gz: 1ccd5529fb4a87b383e500cad777d7c58441b803343753ea93c43f34c940e42d
5
5
  SHA512:
6
- metadata.gz: b6655835b8695913f29fd84e94fcf1700dba61951a24fb32e2d0cb567ff20c340068f0e4f0a56957ce7a1ba697fcace8878a31af69c4c2e3402f0765960ed4ad
7
- data.tar.gz: 4e445fa4b53d19d360325da3e09f190c2959e867d74ed912598bec47aa48dc114b4159eba4f3b8a702a124fa65b091ffbeaea9dc0bfee1cddd693e3f56993535
6
+ metadata.gz: 1727d5e45c7910f3fe631b52329d0fadcb6e9d05eed54ed1731552dcf46c3ba257ade18e53bb51ae9a9bbf5477f69fe16bbff6067e0f495412b1b42c289516d4
7
+ data.tar.gz: 7fe553f310c18547b0274e6f45f2a06b8bedd69df01c2eb06700c62e7fa2434312b2f5dfee9a2f76df3600670fd1f0956a829aba4905b264d7e31700f5bf5b30
data/SECURITY.md ADDED
@@ -0,0 +1,21 @@
1
+ # Security Policy
2
+
3
+ ## Supported Versions
4
+
5
+ Use this section to tell people about which versions of your project are
6
+ currently being supported with security updates.
7
+
8
+ | Version | Supported |
9
+ | ------- | ------------------ |
10
+ | 5.1.x | :white_check_mark: |
11
+ | 5.0.x | :x: |
12
+ | 4.0.x | :white_check_mark: |
13
+ | < 4.0 | :x: |
14
+
15
+ ## Reporting a Vulnerability
16
+
17
+ Use this section to tell people how to report a vulnerability.
18
+
19
+ Tell them where to go, how often they can expect to get an update on a
20
+ reported vulnerability, what to expect if the vulnerability is accepted or
21
+ declined, etc.
@@ -0,0 +1,8 @@
1
+ {
2
+ "folders": [
3
+ {
4
+ "path": "../.."
5
+ }
6
+ ],
7
+ "settings": {}
8
+ }
@@ -42,8 +42,20 @@ module Loggerx
42
42
  obj = proc do |_, _, _, msg|
43
43
  "#{msg}\n"
44
44
  end
45
- register_log_format(obj)
46
- register_log_level(level_hs[level])
45
+ # register_log_format(obj)
46
+ formatter = obj
47
+ # register_log_level(level_hs[level])
48
+ level = level_hs[level]
49
+ end
50
+
51
+ def formatter
52
+ @log_file&.formatter
53
+ # @log_stdout&.formatter
54
+ end
55
+
56
+ def formatter=(obj)
57
+ @log_file&.formatter = obj
58
+ @log_stdout&.formatter = obj
47
59
  end
48
60
 
49
61
  def logger_stdout
@@ -60,30 +72,38 @@ module Loggerx
60
72
  return log_stdout unless log_stdout.nil?
61
73
 
62
74
  begin
63
- # log_stdout = Logger.new($stdout)
64
- log_stdout = Logger.new($stdout)
75
+ log ||= ActiveSupport::TaggedLogging.new($stdout)
65
76
  rescue StandardError
66
77
  @error_stderror_count += 1
67
78
  end
68
- log_stdout
79
+ log
69
80
  end
70
81
 
71
82
  def setup_logger_file(log_dir, fname)
72
83
  filepath = Pathname.new(log_dir).join(fname)
73
84
  log_file = nil
74
85
  begin
75
- log_file = Logger.new(filepath)
86
+ log ||= ActiveSupport::TaggedLogging.new(filepath)
76
87
  rescue Errno::EACCES
77
88
  @error_access_count += 1
78
89
  rescue StandardError
79
90
  @error_stderror_count += 1
80
91
  end
81
- log_file
92
+ log
82
93
  end
83
94
 
84
- def register_log_format(obj)
85
- @log_file&.formatter = obj
86
- @log_stdout&.formatter = obj
95
+ def level
96
+ @log_file&.level
97
+ # @log_stdout&.level
98
+ # Log4r互換インターフェイス
99
+ # DEBUG < INFO < WARN < ERROR < FATAL < UNKNOWN
100
+ end
101
+
102
+ def level=(value)
103
+ @log_file&.level = value
104
+ @log_stdout&.level = value
105
+ # Log4r互換インターフェイス
106
+ # DEBUG < INFO < WARN < ERROR < FATAL < UNKNOWN
87
107
  end
88
108
 
89
109
  def register_log_level(level)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Loggerx
4
- VERSION = "0.2.0"
4
+ VERSION = "0.3.0"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: loggerx
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - ykominami
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-12-17 00:00:00.000000000 Z
11
+ date: 2024-10-19 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Utility class for Logging.
14
14
  email:
@@ -25,20 +25,22 @@ files:
25
25
  - LICENSE.txt
26
26
  - README.md
27
27
  - Rakefile
28
+ - SECURITY.md
28
29
  - lib/loggerx.rb
30
+ - lib/loggerx/loggerx.code-workspace
29
31
  - lib/loggerx/loggerx.rb
30
32
  - lib/loggerx/loggerxcm.rb
31
33
  - lib/loggerx/version.rb
32
34
  - loggerx.code-workspace
33
35
  - sig/loggerx.rbs
34
- homepage:
36
+ homepage:
35
37
  licenses:
36
38
  - MIT
37
39
  metadata:
38
40
  source_code_uri: https://github.com/ykominami/loggerx
39
41
  changelog_uri: https://github.com/ykominami/loggerx/blob/main/CHANGELOG.md
40
42
  rubygems_mfa_required: 'true'
41
- post_install_message:
43
+ post_install_message:
42
44
  rdoc_options: []
43
45
  require_paths:
44
46
  - lib
@@ -53,8 +55,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
53
55
  - !ruby/object:Gem::Version
54
56
  version: '0'
55
57
  requirements: []
56
- rubygems_version: 3.3.7
57
- signing_key:
58
+ rubygems_version: 3.5.14
59
+ signing_key:
58
60
  specification_version: 4
59
61
  summary: Utility class for Logging.
60
62
  test_files: []