react-native-logcat 0.2.2 → 0.2.3

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
  SHA1:
3
- metadata.gz: 211936a66123985d06959fb060c7ac90002e7dce
4
- data.tar.gz: be47fd864caa644f72c8652832c7dcddb52b1d16
3
+ metadata.gz: 5a3490d5d8ed2e930c08e152d343ee6981ed393c
4
+ data.tar.gz: 244eee28ed61f1eb091610c4dae371698317da4b
5
5
  SHA512:
6
- metadata.gz: e022e33e932e40c951300c3e871d83274f5aa456a273ff47084623f6c46775fcd727fd4c014c0e7aeb8ddd5749aae405373d48fc98a97e70c194a571bdf774c3
7
- data.tar.gz: 36fab58e49be66b9ba6efbb195be00f97370b218f079de55b9c934af005aa21044f53d5e020efe88e182f7d0994c23d37bae730dca25292811a9289ef2e93717
6
+ metadata.gz: 2ab781a0321399e26c6e6e063351d6011703c4685eb39bfa4475932814f6b46d6b70a877bf29850a0247938b90de20220c3e95b23a679f74b0c6c1162f4a660f
7
+ data.tar.gz: ed3f1ae1db2211efd9e9c9a798dc95d4c75d540f7ab976e29a28e4d9988d16fc97f8a2e1dfdc559819d461a1477e359254dee0b4560390ae0abb2e76db8095fc
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # react-native logcat [![Gem Version](http://img.shields.io/gem/v/react-native-logcat.svg?style=flat)](http://badge.fury.io/rb/react-native-logcat)
2
2
 
3
- > filter only the react native logcat
3
+ > Filter the react native android logcat
4
4
 
5
5
  <p align="center">
6
6
  <img src="https://raw.githubusercontent.com/cesarferreira/react-native-logcat/master/extras/screenshot.png" width="100%" />
@@ -12,5 +12,6 @@ trap("SIGINT") { throw :ctrl_c }
12
12
  raise
13
13
  rescue Exception => e
14
14
  puts "Ok, i'll go!"
15
+ puts e
15
16
  end
16
17
  end
@@ -3,17 +3,26 @@ require 'colorize'
3
3
 
4
4
  module ReactNativeLogCat
5
5
 
6
- def self.get_type(str)
6
+ def self.add_timestamp(str)
7
+ timestamp = Time.now.strftime("%H:%M:%S")
8
+ return "[#{timestamp}] #{str}"
9
+ end
10
+
11
+ def self.transform_line(str)
7
12
 
8
13
  if str[0..1] == "D/"
9
- return str.green
14
+ return add_timestamp(str.green)
10
15
  end
11
16
 
12
17
  if str[0..1] == "W/"
13
- return str.yellow
18
+ return add_timestamp(str.yellow)
19
+ end
20
+
21
+ if str[0..1] == "E/"
22
+ return add_timestamp(str.red)
14
23
  end
15
24
 
16
- return str
25
+ return add_timestamp(str)
17
26
  end
18
27
 
19
28
  def self.start
@@ -26,7 +35,7 @@ module ReactNativeLogCat
26
35
  }'
27
36
 
28
37
  IO.popen(cmd).each do |line|
29
- puts self.get_type(line.chomp)
38
+ puts self.transform_line(line.chomp)
30
39
  end
31
40
  end
32
41
 
@@ -1,3 +1,3 @@
1
1
  module ReactNativeLogCat
2
- VERSION = "0.2.2"
2
+ VERSION = "0.2.3"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: react-native-logcat
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - cesar ferreira
@@ -91,7 +91,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
91
91
  version: '0'
92
92
  requirements: []
93
93
  rubyforge_project:
94
- rubygems_version: 2.4.5.1
94
+ rubygems_version: 2.4.8
95
95
  signing_key:
96
96
  specification_version: 4
97
97
  summary: Colored logcat for react native