simplex-chat 0.7.1 → 0.7.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.
- checksums.yaml +4 -4
- data/lib/simplex-chat/logging.rb +20 -0
- data/lib/simplex-chat/version.rb +1 -1
- data/lib/simplex-chat.rb +1 -1
- metadata +3 -3
- data/lib/simplex-chat/logger.rb +0 -18
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0bfc340d74770a6d0743b4aaf0c5c61562cf5f6e806e198f4340b289488a9ebe
|
4
|
+
data.tar.gz: 3f0f63f5471ca1716f06d25f491ef069d5d8762f2b29c1a33a830e9d1da1d451
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 513adf1d11a34fe2f116632cf47a566fb11e27f5437c663bab726290432e259e7eaee12f798094fefbb5d27cc407a0a77f4bfed75b220d15487b5bdcc2880211
|
7
|
+
data.tar.gz: fb84278d9b4e71c932da001f73d85e6b58d060cf86184530e406d41a993f4b00a599b437a1dd9f9e666b27ea1223952398deba8c5f30f1f0dab60989e9388709
|
@@ -0,0 +1,20 @@
|
|
1
|
+
require 'logger'
|
2
|
+
|
3
|
+
module SimpleXChat
|
4
|
+
module Logging
|
5
|
+
@@logger = nil
|
6
|
+
|
7
|
+
def self.logger(dest: $stderr, log_level: Logger::INFO)
|
8
|
+
if @@logger == nil
|
9
|
+
@@logger = Logger.new(dest)
|
10
|
+
@@logger.level = log_level
|
11
|
+
@@logger.progname = 'simplex-chat'
|
12
|
+
@@logger.formatter = -> (severity, datetime, progname, msg) {
|
13
|
+
"| [#{severity}] | #{datetime} | (#{progname}) :: #{msg}\n"
|
14
|
+
}
|
15
|
+
end
|
16
|
+
|
17
|
+
@@logger
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
data/lib/simplex-chat/version.rb
CHANGED
data/lib/simplex-chat.rb
CHANGED
@@ -4,7 +4,7 @@ require_relative 'simplex-chat/version'
|
|
4
4
|
require_relative 'simplex-chat/errors'
|
5
5
|
require_relative 'simplex-chat/patches'
|
6
6
|
require_relative 'simplex-chat/types'
|
7
|
-
require_relative 'simplex-chat/
|
7
|
+
require_relative 'simplex-chat/logging'
|
8
8
|
|
9
9
|
module SimpleXChat
|
10
10
|
require 'net/http'
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: simplex-chat
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.7.
|
4
|
+
version: 0.7.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- rdbo
|
8
8
|
bindir: exe
|
9
9
|
cert_chain: []
|
10
|
-
date: 2025-03-
|
10
|
+
date: 2025-03-15 00:00:00.000000000 Z
|
11
11
|
dependencies:
|
12
12
|
- !ruby/object:Gem::Dependency
|
13
13
|
name: websocket
|
@@ -50,7 +50,7 @@ files:
|
|
50
50
|
- lib/simplex-chat.rb
|
51
51
|
- lib/simplex-chat/cmd-runner.rb
|
52
52
|
- lib/simplex-chat/errors.rb
|
53
|
-
- lib/simplex-chat/
|
53
|
+
- lib/simplex-chat/logging.rb
|
54
54
|
- lib/simplex-chat/patches.rb
|
55
55
|
- lib/simplex-chat/types.rb
|
56
56
|
- lib/simplex-chat/version.rb
|
data/lib/simplex-chat/logger.rb
DELETED
@@ -1,18 +0,0 @@
|
|
1
|
-
require 'logger'
|
2
|
-
|
3
|
-
module SimpleXChat
|
4
|
-
module Logging
|
5
|
-
def self.logger(dest: $stderr, log_level: Logger::INFO)
|
6
|
-
if @logger == nil
|
7
|
-
@logger = Logger.new(dest)
|
8
|
-
@logger.level = log_level
|
9
|
-
@logger.progname = 'simplex-chat'
|
10
|
-
@logger.formatter = -> (severity, datetime, progname, msg) {
|
11
|
-
"| [#{severity}] | #{datetime} | (#{progname}) :: #{msg}\n"
|
12
|
-
}
|
13
|
-
end
|
14
|
-
|
15
|
-
@logger
|
16
|
-
end
|
17
|
-
end
|
18
|
-
end
|