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

Make the logs quieter #274

Merged
merged 3 commits into from
Sep 20, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions cmd/apply.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,14 +76,14 @@ real happens.`,

verifyModules := viper.GetBool("verify-modules")
if !verifyModules {
clog.Warn("skipping module verfiction")
clog.Warn("skipping module verification")
}

// execute files
for _, fname := range args {
flog := clog.WithField("file", fname)

flog.Info("applying")
flog.Debug("applying")

stream, err := client.Apply(
ctx,
Expand Down
4 changes: 2 additions & 2 deletions cmd/healthcheck.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,12 @@ not display healthy checks.`,

verifyModules := viper.GetBool("verify-modules")
if !verifyModules {
log.WithField("component", "client").Warn("skipping module verfiction")
log.WithField("component", "client").Warn("skipping module verfiaction")
Copy link
Contributor

Choose a reason for hiding this comment

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

"verification"

}

for _, fname := range args {
flog := log.WithField("file", fname)
flog.Info("checking health")
flog.Debug("checking health")

loaded, err := load.Load(ctx, fname, verifyModules)
if err != nil {
Expand Down
4 changes: 2 additions & 2 deletions cmd/plan.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,14 +76,14 @@ can be done separately to see what needs to be changed before execution.`,

verifyModules := viper.GetBool("verify-modules")
if !verifyModules {
clog.Warn("skipping module verfiction")
clog.Warn("skipping module verification")
}

// execute files
for _, fname := range args {
flog := clog.WithField("file", fname)

flog.Info("planning")
flog.Debug("planning")

stream, err := client.Plan(
ctx,
Expand Down
2 changes: 1 addition & 1 deletion cmd/validate.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ var validateCmd = &cobra.Command{

verifyModules := viper.GetBool("verify-modules")
if !verifyModules {
log.WithField("component", "client").Warn("skipping module verfiction")
log.WithField("component", "client").Warn("skipping module verification")
}

for _, fname := range args {
Expand Down
93 changes: 39 additions & 54 deletions docs/getting-started/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -517,23 +517,20 @@ <h2 id="hello-world">Hello World!</h2>
<h2 id="planning">Planning</h2>

<p>This is our first module! Let&rsquo;s plan out our execution first by running
<code>converge plan helloWorld.hcl</code>:</p>
<code>converge plan --local helloWorld.hcl</code>:</p>

<pre><code class="language-sh">$ converge plan --local helloWorld.hcl
WARN[0000] setting session-local token token=7671639d-b007-4145-994b-0765080bd82c
INFO[0000] serving addr=:47740 component=rpc
INFO[0000] planning component=client file=hello.hcl
INFO[0000] resolving dependencies component=rpc function=ResolveDependencies runID=7ab3e976-8922-4df8-93ef-afd89cf0823c
INFO[0000] loading resources component=rpc function=SetResources runID=7ab3e976-8922-4df8-93ef-afd89cf0823c
INFO[0000] rendering component=rpc function=Render runID=7ab3e976-8922-4df8-93ef-afd89cf0823c
INFO[0000] got status component=client file=hello.hcl id=root/file.content.render run=STARTED stage=PLAN
INFO[0000] got status component=client file=hello.hcl id=root run=STARTED stage=PLAN
2016-09-20T08:05:31-05:00 |WARN| setting session-local token token=309b7660-a0b1-4a88-9fa4-d5f2a139b8de
2016-09-20T08:05:31-05:00 |INFO| serving addr=:47740 component=rpc
2016-09-20T08:05:31-05:00 |WARN| skipping module verification component=client
2016-09-20T08:05:31-05:00 |INFO| got status component=client file=helloWorld.hcl id=root/file.content.render run=STARTED stage=PLAN
2016-09-20T08:05:31-05:00 |INFO| got status component=client file=helloWorld.hcl id=root run=STARTED stage=PLAN

root/file.content.render:
Messages:
Has Changes: yes
Changes:
hello.txt: &quot;&lt;file-missing&gt;&quot; =&gt; &quot;Hello, World!&quot;
Messages:
Has Changes: yes
Changes:
hello.txt: &quot;&lt;file-missing&gt;&quot; =&gt; &quot;Hello, World!&quot;

Summary: 0 errors, 1 changes
</code></pre>
Expand All @@ -545,25 +542,19 @@ <h2 id="planning">Planning</h2>

<h2 id="applying">Applying</h2>

<p>Next, let&rsquo;s actually make the changes, using <code>converge apply</code>:</p>
<p>Next, let&rsquo;s actually make the changes, using <code>converge apply --local helloWorld.hcl</code>:</p>

<pre><code class="language-sh">$ converge apply --local helloWorld.hcl
WARN[0000] setting session-local token token=4ffe080e-bc6b-4655-b7d5-e5456beb1e67
INFO[0000] serving addr=:47740 component=rpc
INFO[0000] applying component=client file=hello.hcl
INFO[0000] resolving dependencies component=rpc function=ResolveDependencies runID=56d53bc1-6fe5-4e17-a8a0-9ba97fd0c65c
INFO[0000] loading resources component=rpc function=SetResources runID=56d53bc1-6fe5-4e17-a8a0-9ba97fd0c65c
INFO[0000] rendering component=rpc function=Render runID=56d53bc1-6fe5-4e17-a8a0-9ba97fd0c65c
INFO[0000] got status component=client file=hello.hcl id=root/file.content.render run=STARTED stage=PLAN
INFO[0000] got status component=client file=hello.hcl id=root run=STARTED stage=PLAN
INFO[0000] got status component=client file=hello.hcl id=root/file.content.render run=STARTED stage=APPLY
INFO[0000] got status component=client file=hello.hcl id=root run=STARTED stage=APPLY
2016-09-20T08:06:21-05:00 |WARN| setting session-local token token=4d9f2774-8ed1-4dc4-8db5-a359b275b3b5
2016-09-20T08:06:21-05:00 |INFO| serving addr=:47740 component=rpc
2016-09-20T08:06:21-05:00 |WARN| skipping module verification component=client
2016-09-20T08:06:21-05:00 |INFO| got status component=client file=helloWorld.hcl id=root/file.content.render run=STARTED stage=APPLY
2016-09-20T08:06:21-05:00 |INFO| got status component=client file=helloWorld.hcl id=root run=STARTED stage=APPLY

root/file.content.render:
Messages:
Has Changes: yes
Changes:
hello.txt: &quot;&lt;file-missing&gt;&quot; =&gt; &quot;Hello, World!&quot;
Messages:
Has Changes: yes
Changes: No changes

Summary: 0 errors, 1 changes
</code></pre>
Expand Down Expand Up @@ -607,20 +598,17 @@ <h2 id="divergence">Divergence!</h2>
plan again.</p>

<pre><code class="language-sh">$ converge plan --local helloWorld.hcl
WARN[0000] setting session-local token token=2157f1e9-6ca9-4e6f-a203-096608c9adcd
INFO[0000] serving addr=:47740 component=rpc
INFO[0000] planning component=client file=hello.hcl
INFO[0000] resolving dependencies component=rpc function=ResolveDependencies runID=5ca7bb15-c4b2-4453-b065-ac5cba288c82
INFO[0000] loading resources component=rpc function=SetResources runID=5ca7bb15-c4b2-4453-b065-ac5cba288c82
INFO[0000] rendering component=rpc function=Render runID=5ca7bb15-c4b2-4453-b065-ac5cba288c82
INFO[0000] got status component=client file=hello.hcl id=root/file.content.render run=STARTED stage=PLAN
INFO[0000] got status component=client file=hello.hcl id=root run=STARTED stage=PLAN
2016-09-20T08:07:02-05:00 |WARN| setting session-local token token=c61a0f03-2f4d-43cd-9722-1482e6396b70
2016-09-20T08:07:02-05:00 |INFO| serving addr=:47740 component=rpc
2016-09-20T08:07:02-05:00 |WARN| skipping module verification component=client
2016-09-20T08:07:02-05:00 |INFO| got status component=client file=helloWorld.hcl id=root/file.content.render run=STARTED stage=PLAN
2016-09-20T08:07:02-05:00 |INFO| got status component=client file=helloWorld.hcl id=root run=STARTED stage=PLAN

root/file.content.render:
Messages:
Has Changes: yes
Changes:
hello.txt: &quot;LOL World!&quot; =&gt; &quot;Hello, World!&quot;
Messages:
Has Changes: yes
Changes:
hello.txt: &quot;LOL World!&quot; =&gt; &quot;Hello, World!&quot;

Summary: 0 errors, 1 changes
</code></pre>
Expand Down Expand Up @@ -660,22 +648,19 @@ <h2 id="params">Params</h2>
<p>Let&rsquo;s change the name in the template to your name (I&rsquo;m going to assume it&rsquo;s
&ldquo;Spartacus&rdquo;.) We&rsquo;ll use the <code>-p</code> flag to <code>converge plan</code> to see what&rsquo;ll happen:</p>

<pre><code class="language-sh">$ converge plan --local -p name=Spartacus content/helloWorld.hcl
WARN[0000] setting session-local token token=dc73ca2e-d5dc-46d6-a2e4-81b848e7309c
INFO[0000] serving addr=:47740 component=rpc
INFO[0000] planning component=client file=hello.hcl
INFO[0000] resolving dependencies component=rpc function=ResolveDependencies runID=91562f11-df7b-4e8e-8fda-d341531afe92
INFO[0000] loading resources component=rpc function=SetResources runID=91562f11-df7b-4e8e-8fda-d341531afe92
INFO[0000] rendering component=rpc function=Render runID=91562f11-df7b-4e8e-8fda-d341531afe92
INFO[0000] got status component=client file=hello.hcl id=root/param.name run=STARTED stage=PLAN
INFO[0000] got status component=client file=hello.hcl id=root/file.content.render run=STARTED stage=PLAN
INFO[0000] got status component=client file=hello.hcl id=root run=STARTED stage=PLAN
<pre><code class="language-sh">$ converge plan --local -p name=Spartacus helloWorld.hcl
2016-09-20T08:07:51-05:00 |WARN| setting session-local token token=376ae4d9-8c7a-4581-be05-4c3cb8401798
2016-09-20T08:07:51-05:00 |INFO| serving addr=:47740 component=rpc
2016-09-20T08:07:51-05:00 |WARN| skipping module verification component=client
2016-09-20T08:07:51-05:00 |INFO| got status component=client file=helloWorld.hcl id=root/param.name run=STARTED stage=PLAN
2016-09-20T08:07:51-05:00 |INFO| got status component=client file=helloWorld.hcl id=root/file.content.render run=STARTED stage=PLAN
2016-09-20T08:07:51-05:00 |INFO| got status component=client file=helloWorld.hcl id=root run=STARTED stage=PLAN

root/file.content.render:
Messages:
Has Changes: yes
Changes:
hello.txt: &quot;LOL World!&quot; =&gt; &quot;Hello, Spartacus!&quot;
Messages:
Has Changes: yes
Changes:
hello.txt: &quot;Hello, World!&quot; =&gt; &quot;Hello, Spartacus!&quot;

Summary: 0 errors, 1 changes
</code></pre>
Expand Down
93 changes: 39 additions & 54 deletions docs_source/content/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,24 +29,21 @@ file.content "render" {
## Planning

This is our first module! Let's plan out our execution first by running
`converge plan helloWorld.hcl`:
`converge plan --local helloWorld.hcl`:

```sh
$ converge plan --local helloWorld.hcl
WARN[0000] setting session-local token token=7671639d-b007-4145-994b-0765080bd82c
INFO[0000] serving addr=:47740 component=rpc
INFO[0000] planning component=client file=hello.hcl
INFO[0000] resolving dependencies component=rpc function=ResolveDependencies runID=7ab3e976-8922-4df8-93ef-afd89cf0823c
INFO[0000] loading resources component=rpc function=SetResources runID=7ab3e976-8922-4df8-93ef-afd89cf0823c
INFO[0000] rendering component=rpc function=Render runID=7ab3e976-8922-4df8-93ef-afd89cf0823c
INFO[0000] got status component=client file=hello.hcl id=root/file.content.render run=STARTED stage=PLAN
INFO[0000] got status component=client file=hello.hcl id=root run=STARTED stage=PLAN
2016-09-20T08:05:31-05:00 |WARN| setting session-local token token=309b7660-a0b1-4a88-9fa4-d5f2a139b8de
2016-09-20T08:05:31-05:00 |INFO| serving addr=:47740 component=rpc
2016-09-20T08:05:31-05:00 |WARN| skipping module verification component=client
2016-09-20T08:05:31-05:00 |INFO| got status component=client file=helloWorld.hcl id=root/file.content.render run=STARTED stage=PLAN
2016-09-20T08:05:31-05:00 |INFO| got status component=client file=helloWorld.hcl id=root run=STARTED stage=PLAN

root/file.content.render:
Messages:
Has Changes: yes
Changes:
hello.txt: "<file-missing>" => "Hello, World!"
Messages:
Has Changes: yes
Changes:
hello.txt: "<file-missing>" => "Hello, World!"

Summary: 0 errors, 1 changes
```
Expand All @@ -58,26 +55,20 @@ output.

## Applying

Next, let's actually make the changes, using `converge apply`:
Next, let's actually make the changes, using `converge apply --local helloWorld.hcl`:

```sh
$ converge apply --local helloWorld.hcl
WARN[0000] setting session-local token token=4ffe080e-bc6b-4655-b7d5-e5456beb1e67
INFO[0000] serving addr=:47740 component=rpc
INFO[0000] applying component=client file=hello.hcl
INFO[0000] resolving dependencies component=rpc function=ResolveDependencies runID=56d53bc1-6fe5-4e17-a8a0-9ba97fd0c65c
INFO[0000] loading resources component=rpc function=SetResources runID=56d53bc1-6fe5-4e17-a8a0-9ba97fd0c65c
INFO[0000] rendering component=rpc function=Render runID=56d53bc1-6fe5-4e17-a8a0-9ba97fd0c65c
INFO[0000] got status component=client file=hello.hcl id=root/file.content.render run=STARTED stage=PLAN
INFO[0000] got status component=client file=hello.hcl id=root run=STARTED stage=PLAN
INFO[0000] got status component=client file=hello.hcl id=root/file.content.render run=STARTED stage=APPLY
INFO[0000] got status component=client file=hello.hcl id=root run=STARTED stage=APPLY
2016-09-20T08:06:21-05:00 |WARN| setting session-local token token=4d9f2774-8ed1-4dc4-8db5-a359b275b3b5
2016-09-20T08:06:21-05:00 |INFO| serving addr=:47740 component=rpc
2016-09-20T08:06:21-05:00 |WARN| skipping module verification component=client
2016-09-20T08:06:21-05:00 |INFO| got status component=client file=helloWorld.hcl id=root/file.content.render run=STARTED stage=APPLY
2016-09-20T08:06:21-05:00 |INFO| got status component=client file=helloWorld.hcl id=root run=STARTED stage=APPLY

root/file.content.render:
Messages:
Has Changes: yes
Changes:
hello.txt: "<file-missing>" => "Hello, World!"
Messages:
Has Changes: yes
Changes: No changes

Summary: 0 errors, 1 changes
```
Expand Down Expand Up @@ -108,20 +99,17 @@ plan again.

```sh
$ converge plan --local helloWorld.hcl
WARN[0000] setting session-local token token=2157f1e9-6ca9-4e6f-a203-096608c9adcd
INFO[0000] serving addr=:47740 component=rpc
INFO[0000] planning component=client file=hello.hcl
INFO[0000] resolving dependencies component=rpc function=ResolveDependencies runID=5ca7bb15-c4b2-4453-b065-ac5cba288c82
INFO[0000] loading resources component=rpc function=SetResources runID=5ca7bb15-c4b2-4453-b065-ac5cba288c82
INFO[0000] rendering component=rpc function=Render runID=5ca7bb15-c4b2-4453-b065-ac5cba288c82
INFO[0000] got status component=client file=hello.hcl id=root/file.content.render run=STARTED stage=PLAN
INFO[0000] got status component=client file=hello.hcl id=root run=STARTED stage=PLAN
2016-09-20T08:07:02-05:00 |WARN| setting session-local token token=c61a0f03-2f4d-43cd-9722-1482e6396b70
2016-09-20T08:07:02-05:00 |INFO| serving addr=:47740 component=rpc
2016-09-20T08:07:02-05:00 |WARN| skipping module verification component=client
2016-09-20T08:07:02-05:00 |INFO| got status component=client file=helloWorld.hcl id=root/file.content.render run=STARTED stage=PLAN
2016-09-20T08:07:02-05:00 |INFO| got status component=client file=helloWorld.hcl id=root run=STARTED stage=PLAN

root/file.content.render:
Messages:
Has Changes: yes
Changes:
hello.txt: "LOL World!" => "Hello, World!"
Messages:
Has Changes: yes
Changes:
hello.txt: "LOL World!" => "Hello, World!"

Summary: 0 errors, 1 changes
```
Expand Down Expand Up @@ -162,22 +150,19 @@ Let's change the name in the template to your name (I'm going to assume it's
"Spartacus".) We'll use the `-p` flag to `converge plan` to see what'll happen:

```sh
$ converge plan --local -p name=Spartacus content/helloWorld.hcl
WARN[0000] setting session-local token token=dc73ca2e-d5dc-46d6-a2e4-81b848e7309c
INFO[0000] serving addr=:47740 component=rpc
INFO[0000] planning component=client file=hello.hcl
INFO[0000] resolving dependencies component=rpc function=ResolveDependencies runID=91562f11-df7b-4e8e-8fda-d341531afe92
INFO[0000] loading resources component=rpc function=SetResources runID=91562f11-df7b-4e8e-8fda-d341531afe92
INFO[0000] rendering component=rpc function=Render runID=91562f11-df7b-4e8e-8fda-d341531afe92
INFO[0000] got status component=client file=hello.hcl id=root/param.name run=STARTED stage=PLAN
INFO[0000] got status component=client file=hello.hcl id=root/file.content.render run=STARTED stage=PLAN
INFO[0000] got status component=client file=hello.hcl id=root run=STARTED stage=PLAN
$ converge plan --local -p name=Spartacus helloWorld.hcl
2016-09-20T08:07:51-05:00 |WARN| setting session-local token token=376ae4d9-8c7a-4581-be05-4c3cb8401798
2016-09-20T08:07:51-05:00 |INFO| serving addr=:47740 component=rpc
2016-09-20T08:07:51-05:00 |WARN| skipping module verification component=client
2016-09-20T08:07:51-05:00 |INFO| got status component=client file=helloWorld.hcl id=root/param.name run=STARTED stage=PLAN
2016-09-20T08:07:51-05:00 |INFO| got status component=client file=helloWorld.hcl id=root/file.content.render run=STARTED stage=PLAN
2016-09-20T08:07:51-05:00 |INFO| got status component=client file=helloWorld.hcl id=root run=STARTED stage=PLAN

root/file.content.render:
Messages:
Has Changes: yes
Changes:
hello.txt: "LOL World!" => "Hello, Spartacus!"
Messages:
Has Changes: yes
Changes:
hello.txt: "Hello, World!" => "Hello, Spartacus!"

Summary: 0 errors, 1 changes
```
Expand Down
2 changes: 1 addition & 1 deletion load/dependencyresolver.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ type dependencyGenerator func(node *parse.Node) ([]string, error)
// the graph and creates edges to fit them
func ResolveDependencies(ctx context.Context, g *graph.Graph) (*graph.Graph, error) {
logger := logging.GetLogger(ctx).WithField("function", "ResolveDependencies")
logger.Info("resolving dependencies")
logger.Debug("resolving dependencies")

return g.Transform(ctx, func(id string, out *graph.Graph) error {
if id == "root" { // skip root
Expand Down
2 changes: 1 addition & 1 deletion load/resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ import (
// SetResources loads the resources for each graph node
func SetResources(ctx context.Context, g *graph.Graph) (*graph.Graph, error) {
logger := logging.GetLogger(ctx).WithField("function", "SetResources")
logger.Info("loading resources")
logger.Debug("loading resources")

return g.Transform(ctx, func(id string, out *graph.Graph) error {
if id == "root" { // root
Expand Down
2 changes: 1 addition & 1 deletion resource/shell/preparer.go
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ func checkSyntax(interpreter string, flags []string, script string) error {
} else {
if len(flags) == 0 {
// TODO: add ID in here somehow
log.Info("no check_flags specified for interpeter, skipping syntax validation")
log.Debug("no check_flags specified for interpeter, skipping syntax validation")
return nil
}
}
Expand Down
Loading