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
Mitch Garnaat
2014-11-29 07:43:08 -0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
eb8969a1b0ea709b3cc6bd53dcd39d1b32bedebf
eb8969a1
1 parent
99fdb234
Added a few comments and removed redundant timestamp when printing log events.
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
1 deletions
kappa/__init__.py
kappa/__init__.py
View file @
eb8969a
...
...
@@ -154,9 +154,11 @@ class Kappa(object):
def
_tail
(
self
,
function_name
):
LOG
.
debug
(
'tailing function:
%
s'
,
function_name
)
log_svc
=
self
.
session
.
create_client
(
'logs'
,
self
.
region
)
# kinda kludgy but can't find any way to get log group name
log_group_name
=
'/aws/lambda/
%
s'
%
function_name
latest_stream
=
None
response
=
log_svc
.
describe_log_streams
(
logGroupName
=
log_group_name
)
# The streams are not ordered by time, hence this ugliness
for
stream
in
response
[
'logStreams'
]:
if
not
latest_stream
:
latest_stream
=
stream
...
...
@@ -166,7 +168,7 @@ class Kappa(object):
logGroupName
=
log_group_name
,
logStreamName
=
latest_stream
[
'logStreamName'
])
for
log_event
in
response
[
'events'
]:
print
(
'
%
s:
%
s'
%
(
log_event
[
'timestamp'
],
log_event
[
'message'
])
)
print
(
log_event
[
'message'
]
)
def
add_event_source
(
self
):
lambda_svc
=
self
.
session
.
create_client
(
'lambda'
,
self
.
region
)
...
...
Please
register
or
login
to post a comment