Toggle navigation
Toggle navigation
This project
Loading...
Sign in
서승완
/
kappa
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Graphs
Network
Create a new issue
Commits
Issue Boards
Authored by
Ryan S. Brown
2015-03-22 12:00:36 -0400
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
240e7b137ff767dd7a83b45843dc72195b3363f2
240e7b13
1 parent
49ec8c0e
Print last 10 log messages when executing `kappa <config> tail`
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
6 deletions
bin/kappa
bin/kappa
View file @
240e7b1
...
...
@@ -11,6 +11,7 @@
# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
# ANY KIND, either express or implied. See the License for the specific
# language governing permissions and limitations under the License.
from
datetime
import
datetime
import
logging
import
click
...
...
@@ -42,7 +43,7 @@ def deploy(ctx):
click
.
echo
(
'deploying...'
)
context
.
deploy
()
click
.
echo
(
'...done'
)
@cli.command
()
@click.pass_context
def
test
(
ctx
):
...
...
@@ -50,15 +51,17 @@ def test(ctx):
click
.
echo
(
'testing...'
)
context
.
test
()
click
.
echo
(
'...done'
)
@cli.command
()
@click.pass_context
def
tail
(
ctx
):
context
=
Context
(
ctx
.
obj
[
'config'
],
ctx
.
obj
[
'debug'
])
click
.
echo
(
'tailing logs...'
)
context
.
tail
()
for
e
in
context
.
tail
()[
-
10
:]:
ts
=
datetime
.
utcfromtimestamp
(
e
[
'timestamp'
]
//
1000
)
.
isoformat
()
click
.
echo
(
"{}: {}"
.
format
(
ts
,
e
[
'message'
]))
click
.
echo
(
'...done'
)
@cli.command
()
@click.pass_context
def
status
(
ctx
):
...
...
@@ -91,7 +94,7 @@ def status(ctx):
click
.
echo
(
click
.
style
(
line
,
fg
=
'green'
))
else
:
click
.
echo
(
click
.
style
(
' None'
,
fg
=
'green'
))
@cli.command
()
@click.pass_context
def
delete
(
ctx
):
...
...
@@ -99,7 +102,7 @@ def delete(ctx):
click
.
echo
(
'deleting...'
)
context
.
delete
()
click
.
echo
(
'...done'
)
@cli.command
()
@click.pass_context
def
add_event_sources
(
ctx
):
...
...
Please
register
or
login
to post a comment