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 +4 -4
- data/README.md +1 -1
- data/bin/react-native-logcat +1 -0
- data/lib/react-native-logcat.rb +14 -5
- data/lib/react-native-logcat/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5a3490d5d8ed2e930c08e152d343ee6981ed393c
|
4
|
+
data.tar.gz: 244eee28ed61f1eb091610c4dae371698317da4b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
>
|
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%" />
|
data/bin/react-native-logcat
CHANGED
data/lib/react-native-logcat.rb
CHANGED
@@ -3,17 +3,26 @@ require 'colorize'
|
|
3
3
|
|
4
4
|
module ReactNativeLogCat
|
5
5
|
|
6
|
-
def self.
|
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.
|
38
|
+
puts self.transform_line(line.chomp)
|
30
39
|
end
|
31
40
|
end
|
32
41
|
|
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.
|
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.
|
94
|
+
rubygems_version: 2.4.8
|
95
95
|
signing_key:
|
96
96
|
specification_version: 4
|
97
97
|
summary: Colored logcat for react native
|