logstream 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/README.md +1 -1
- data/bin/logstream +6 -2
- data/lib/logstream/client.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
SHA1:
|
3
|
-
data.tar.gz: 7733c436237beeea2f4209b81ea8881ca3ae9f54
|
4
|
-
metadata.gz: 0cbaedb3f433566f0acd608d0ff8f603ca3b04ed
|
5
2
|
SHA512:
|
6
|
-
|
7
|
-
|
3
|
+
metadata.gz: 06c96a47aee89d924f5236187952a721411150a2d67595ed17200d2a3b8ee4d8ed8cc27f6a9e922826d9bb56f7172f328701e9eb59559b4bc4924045703ee8c6
|
4
|
+
data.tar.gz: 19059ff9cdf5d49145ae07b0089e22eff70828cea9065f11565c500901b69cadecdecc087d193de6959ddbe43d07fbcfa14662bba9583a850f9ed37a39617545
|
5
|
+
SHA1:
|
6
|
+
metadata.gz: 276541c6845b82c0fda50665669b246facd4a22e
|
7
|
+
data.tar.gz: d3ecbd6440b5c74c44e80a5583e7f35c5559107e
|
data/README.md
CHANGED
@@ -10,7 +10,7 @@ supports streaming a variety of log sources:
|
|
10
10
|
* Varnish cache logs
|
11
11
|
|
12
12
|
This repository contains a client-side library and CLI. Acquia Cloud provides
|
13
|
-
<a href="https://docs.acquia.com/cloud/configure/logging">a browser-based
|
13
|
+
<a href="https://docs.acquia.com/cloud/configure/logging/stream">a browser-based
|
14
14
|
UI</a> as well.
|
15
15
|
|
16
16
|
## Quick start
|
data/bin/logstream
CHANGED
@@ -6,6 +6,7 @@ require 'json'
|
|
6
6
|
require 'thor'
|
7
7
|
require 'logstream/client'
|
8
8
|
|
9
|
+
# @todo: Yeah, this is terrible. Replace it with a real Cloud API gem.
|
9
10
|
class QuickCloudAPI
|
10
11
|
class Error < StandardError; end
|
11
12
|
|
@@ -41,8 +42,8 @@ class LogTailorCLI < Thor
|
|
41
42
|
desc "tail SITE ENV", "Stream log information for the specified site environment."
|
42
43
|
method_option(:types, :type => :array, :aliases => '-t',
|
43
44
|
:desc => "Only display listed log types",
|
44
|
-
:default => %w(apache-
|
45
|
-
:banner => "apache-
|
45
|
+
:default => %w(apache-request php-error drupal-watchdog varnish-request),
|
46
|
+
:banner => "apache-request apache-error php-error drupal-request drupal-watchdog varnish-request"
|
46
47
|
)
|
47
48
|
method_option(:show, :type => :array, :aliases => '-s',
|
48
49
|
:desc => "Fow rows containing the column, only show them if the column matches the regexp.",
|
@@ -59,6 +60,7 @@ class LogTailorCLI < Thor
|
|
59
60
|
)
|
60
61
|
method_option(:color, :type => :boolean, :default => true, :desc => 'Turn on or off colorized lines.')
|
61
62
|
method_option(:endpoint, :type => :string, :desc => 'The Cloud API URL to connect to.')
|
63
|
+
method_option(:debug, :type => :boolean, :default => false, :desc => 'Turn on debugging.')
|
62
64
|
def tail(site, env)
|
63
65
|
begin
|
64
66
|
shows = Hash[options[:show].map { |s| s.split('=') }.map { |k,v| [k, Regexp.new(v)] }] rescue {}
|
@@ -68,9 +70,11 @@ class LogTailorCLI < Thor
|
|
68
70
|
info = QuickCloudAPI.get("/sites/#{site}/envs/#{env}/logstream", { :endpoint => options[:endpoint] })
|
69
71
|
logstream = Logstream::Client.new({
|
70
72
|
:columns => options[:columns],
|
73
|
+
:types => options[:types],
|
71
74
|
:shows => shows,
|
72
75
|
:hides => hides,
|
73
76
|
:no_color => !options[:color],
|
77
|
+
:debug => options[:debug],
|
74
78
|
})
|
75
79
|
logstream.run(info['url'], info['msg'])
|
76
80
|
rescue QuickCloudAPI::Error => e
|
data/lib/logstream/client.rb
CHANGED
@@ -54,7 +54,7 @@ module Logstream
|
|
54
54
|
ws.close
|
55
55
|
EM.stop
|
56
56
|
when 'available'
|
57
|
-
send_msg(ws, { 'cmd' => 'enable', 'type' => msg['type'], 'server' => msg['server'] })
|
57
|
+
send_msg(ws, { 'cmd' => 'enable', 'type' => msg['type'], 'server' => msg['server'] }) if @opts[:types].include?(msg['type'])
|
58
58
|
when 'line'
|
59
59
|
next unless msg.all? { |k,v| @opts[:shows][k].nil? || v =~ shows[k] }
|
60
60
|
next if msg.any? { |k,v| @opts[:hides][k] && v =~ hides[k] }
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: logstream
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Barry Jaspan
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2014-06-
|
12
|
+
date: 2014-06-12 00:00:00 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: faye-websocket
|