Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deployment Logs #93

Merged
merged 9 commits into from
Feb 26, 2018
Merged

Deployment Logs #93

merged 9 commits into from
Feb 26, 2018

Conversation

bobheadxi
Copy link
Member

@bobheadxi bobheadxi commented Feb 24, 2018

Status: Ready

🎟️ Ticket(s): Closes #37


👷 Changes

  • Stream Inertia daemon logs with inertia local logs --stream, or access most recent logs with inertia local logs
  • Stream docker-compose logs or specific containers using inertia local logs docker-compose or inertia local logs mycontainer specifically
    -Reworked logging, though this is bugged right now:

https://github.com/ubclaunchpad/inertia/blob/rob/%2337-deployment-logs/daemon/handler.go#L196 doesn't seem to properly return the error to the client - I think its still floating around somewhere because if I run inertia local up again, the line that was supposed to be returned shows up in the container logs alongside the first log from the second call
FIXED as of 754d625, turns out a newline is needed for the flush to trigger

🔦 Testing Instructions

inertia local init
inertia local up
inertia local logs --stream # stream inertia daemon logs
inertia local logs docker-compose --stream

@bobheadxi bobheadxi added the pr: finalized needs review and final approval label Feb 24, 2018
@coveralls
Copy link

coveralls commented Feb 24, 2018

Coverage Status

Coverage decreased (-0.5%) to 25.093% when pulling 754d625 on rob/#37-deployment-logs into 9151683 on master.

Copy link
Contributor

@chadlagore chadlagore left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Super cool 😎

type DaemonRequest struct {
Stream bool `json:"stream"`
Repo string `json:"repo,omitempty"`
Container string `json:"container,omitempty"`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As handy as this JSON language is, it feels like a smell to me

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hm what do you mean?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It just feels like it got hacked onto the language. Its very handy, but something feels strange about it. I'm just murmuring out loud, ignore me 👍

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

true, functionality-wise I think it's quite nice though 😛

// Run daemon on port
log.Println("Serving daemon on port " + port)
mux := http.NewServeMux()
// Example usage of `authorized' decorator.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can kill my old silly comments, think it’s clear what’s goin down here now😜

* New logger class and functions
* Migrated "--stream"-supported handlers to new logger
* Removed daemon dependency on pkg "log" due to datetime duplication when reporting container logs
@bobheadxi bobheadxi added pr: wip in progress but seeking feedback and removed pr: finalized needs review and final approval labels Feb 25, 2018
@bobheadxi bobheadxi added pr: finalized needs review and final approval and removed pr: wip in progress but seeking feedback labels Feb 26, 2018
@bobheadxi bobheadxi merged commit d22069c into master Feb 26, 2018
@bobheadxi bobheadxi deleted the rob/#37-deployment-logs branch February 26, 2018 04:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr: finalized needs review and final approval
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants