logzomg 0.1.0.4 → 0.1.0.5

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 21f2c7611f4c1c92b251072d7e87d31d0cfae6fd
4
- data.tar.gz: cdb1b149bd728805bab77d0e8b7aeb7247ce0f40
3
+ metadata.gz: eb8614e2373f7bba05b6742bb942ed4f7d488cba
4
+ data.tar.gz: e7a782bbd10e84758eeab014afd6c135f89608f4
5
5
  SHA512:
6
- metadata.gz: 223066806ccaad8d66b95bd351f7dad256d30a34eb376de2d200b51c91caaf8aa7bf8f11d0b95f2da2edde044713def5ebfc6d8711905e2d40bf02a2ac10e7e3
7
- data.tar.gz: 26adc2ac570d79416e88c36f853f0a34f7c5eb7e3e0e955dbd6346b50346697b810e2bb9d63d5a327e56633064bb78f78b48e6eadd01684308a7b3909b884406
6
+ metadata.gz: 65ec4e38dbdc09060ca19556ca7ce0ff079ebee4df2ec5edadf2ea52f4bec6a2c91c636d85104e32aa12edf0772dbc99aead1a9d0d6e50e19546d598114a1059
7
+ data.tar.gz: 599d8ae835763748cbf31480b3b03ca7601f0eed1db2fb15cd2814d49edc1190e0315d9e6a87e4b079b2fc88049310d73cb06352785dfa1ea3c5377a5bebea97
data/.gitignore CHANGED
@@ -9,4 +9,4 @@
9
9
  /tmp/
10
10
  /logs/
11
11
 
12
- /logzomg-*/
12
+ /*.gem
data/README.md CHANGED
@@ -2,9 +2,9 @@
2
2
 
3
3
  **Logzomg is still in development. Do not expect crazy functionality yet :)**
4
4
 
5
- An easy to use and lightweight logging gem for Ruby.
5
+ An easy to use and modern logging gem made for Rails APIs.
6
6
 
7
- ![Terminal output](http://i.imgur.com/dsQyWNo.png)
7
+ ![Terminal output](http://i.imgur.com/SFvnXXm.png)
8
8
 
9
9
  Logzomg currently supports varying levels of severity.
10
10
 
@@ -26,28 +26,25 @@ Fatal
26
26
 
27
27
  ## Usage
28
28
 
29
- The logger takes a hash in and formats the key-value pairs. The key msg will always be displayed last.
29
+ The logger takes a hash in and formats the key-value pairs. Msg must always be included and will always be shown first.
30
30
 
31
- You can instantiate the logger and use it like so:
31
+ You can instantiate the logger and give it X amount of key/value pairs.
32
32
 
33
33
  ```ruby
34
34
  def log
35
35
  l = Logzomg::Logger.new
36
36
  l.log({
37
- number: 3,
38
- entity: "Acro-yoga enthusiasts",
39
- wild: true,
40
- msg: "Have been spotted!",
41
- damn: "son",
42
- level: "info", # Optional. Sets log level. Default is warning
43
- file: "help.txt" # Optional. Sets name of file to log to. Default is log.txt
44
- })
37
+ number: 3,
38
+ entity: "Acro-yoga enthusiasts",
39
+ wild: true,
40
+ msg: "Have been spotted!",
41
+ damn: "son",
42
+ level: "info", # Optional. Sets log level. Default is warning
43
+ file: "help.txt" # Optional. Sets name of file to log to. Default is log.txt
44
+ })
45
45
  end
46
46
  ```
47
47
 
48
- Giving this result:
49
- ![Terminal output](http://i.imgur.com/IvprMBS.png)
50
-
51
48
  By default Logzomg color codes the logging levels when viewed in a terminal. If you want to turn this off you can instead pass a TextFormatter when instantiating the logger.
52
49
 
53
50
  The TextFormatter takes a hash of options.
@@ -55,14 +52,12 @@ The TextFormatter takes a hash of options.
55
52
  ```ruby
56
53
  def logger
57
54
  Logzomg::Logger.new(formatter: TextFormatter.new { |f|
58
- f.with_color = true
59
- f.short_date = true
55
+ f.with_color = true
56
+ f.short_date = true
60
57
  })
61
58
  end
62
59
  ```
63
60
 
64
- Currently Logzomg only supports logging as plaintext. Soon it will support logging as JSON as well.
65
-
66
61
 
67
62
  ## Installation
68
63
 
@@ -1,8 +1,8 @@
1
1
  require 'date'
2
2
 
3
3
  class TextFormatter
4
- MAX_CHAR = 150
5
- MAX_CHAR_FLOAT = 145.00 # There's some problems with float decimal precision. Keep this 5 below MAX_CHAR
4
+ MAX_CHAR = 130
5
+ MAX_CHAR_FLOAT = 125.00 # There's some problems with float decimal precision. Keep this 5 below MAX_CHAR
6
6
  COLORS = {
7
7
  info: "96",
8
8
  warning: "33",
@@ -76,6 +76,6 @@ class TextFormatter
76
76
  def split_msg(msg)
77
77
  sub_end = MAX_CHAR - 5
78
78
  # Goes back to start of word if matches inside a word. If it matches inside a coloured key go back to start of word before colour
79
- msg.scan(/.{0,#{Regexp.escape(sub_end.to_s)}}[^\\033\[0-90-9m\]\w\\e\[0m:\$](?:\ |$)/mi)
79
+ msg.scan(/.{0,#{Regexp.escape(sub_end.to_s)}}[\\033\[0-90-9m\]\w\\e\[0m](?:\ |$)/mi).each { |n| n.slice!(0) if n[0] == " "}
80
80
  end
81
81
  end
data/lib/logzomg.rb CHANGED
@@ -64,6 +64,14 @@ module Logzomg
64
64
  nigga: "what",
65
65
  level: "debug"
66
66
  })
67
+ self.log({
68
+ msg: "This is very long This is very long This is very long This is very long This is very long This is very long This is very long This is very long This is very long This is very long This is very long This is very long This is very long ",
69
+ long: true,
70
+ what: true,
71
+ bugged: false,
72
+ nigga: "what",
73
+ level: "debug"
74
+ })
67
75
  self.log({
68
76
  msg: "Something is on the horizon!",
69
77
  spotted: "unknown",
@@ -73,8 +81,12 @@ module Logzomg
73
81
  number: 3,
74
82
  entity: "Acro-yoga enthusiasts",
75
83
  wild: true,
76
- msg: "Have been spotted!",
84
+ msg: "Something has been spotted!",
77
85
  damn: "son",
86
+ damn2: "son",
87
+ damn3: "son",
88
+ damn4: "son",
89
+ damn5: "son",
78
90
  level: "info"
79
91
  })
80
92
  self.log({
@@ -1,3 +1,3 @@
1
1
  module Logzomg
2
- VERSION = "0.1.0.4"
2
+ VERSION = "0.1.0.5"
3
3
  end
data/logzomg.gemspec CHANGED
@@ -8,7 +8,7 @@ Gem::Specification.new do |spec|
8
8
  spec.version = Logzomg::VERSION
9
9
  spec.authors = ["Rasmus"]
10
10
  spec.email = ["Rasmusbreiler@gmail.com"]
11
- spec.description = "An easy to use, lightweight logging gem for Ruby applications"
11
+ spec.description = "An easy to use, lightweight logging gem for Rails applications"
12
12
 
13
13
  spec.summary = %q{Logging gem with Asana API integration}
14
14
  spec.homepage = "https://github.com/Evilbits/logzomg"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: logzomg
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0.4
4
+ version: 0.1.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rasmus
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-08-31 00:00:00.000000000 Z
11
+ date: 2017-09-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -52,7 +52,7 @@ dependencies:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
54
  version: '3.0'
55
- description: An easy to use, lightweight logging gem for Ruby applications
55
+ description: An easy to use, lightweight logging gem for Rails applications
56
56
  email:
57
57
  - Rasmusbreiler@gmail.com
58
58
  executables: []
@@ -71,11 +71,6 @@ files:
71
71
  - lib/formatters/text_formatter.rb
72
72
  - lib/logzomg.rb
73
73
  - lib/logzomg/version.rb
74
- - logzomg-0.1.0.1.gem
75
- - logzomg-0.1.0.2.gem
76
- - logzomg-0.1.0.3.1.gem
77
- - logzomg-0.1.0.3.gem
78
- - logzomg-0.1.0.gem
79
74
  - logzomg.gemspec
80
75
  homepage: https://github.com/Evilbits/logzomg
81
76
  licenses:
data/logzomg-0.1.0.1.gem DELETED
Binary file
data/logzomg-0.1.0.2.gem DELETED
Binary file
Binary file
data/logzomg-0.1.0.3.gem DELETED
Binary file
data/logzomg-0.1.0.gem DELETED
Binary file