Skip to content

Commit

Permalink
Tiny docs improvements (#309)
Browse files Browse the repository at this point in the history
  • Loading branch information
note authored Nov 28, 2023
1 parent 2b86c0c commit c980e84
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -151,14 +151,14 @@ Every example is a valid Pulumi program that can be tested by manually
doing `pulumi up` in the right folder.

```bash
cd exmaples/<example-name>
cd examples/<example-name>
pulumi up
```

Here is a Just helper to run the automated testing:

```bash
just test-example aws-scala-webserver
just test-example aws-webserver
```

### Testing templates locally
Expand Down
8 changes: 7 additions & 1 deletion website/docs/logging.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,16 @@ logger by writing `log` with a following severity level used as a logging method
```scala
@main def run = Pulumi.run {
for
_ <- log.warning("Nothing to do.")
_ <- log.warn("Nothing to do.")
yield Pulumi.exports()
}
```

Logging is an asynchronous operation and returns an `Output`. This means that all logging statements need to be composed
into the flow of your program. This is similar to how logging frameworks for `cats` or `ZIO` behave (eg.: [log4cats](https://github.com/typelevel/log4cats)).

### Why not simply `println`?

Given that you're working with CLI you might be tempted to just `println` some value, but that will have no visible effect.
That's because Besom's Scala code is being executed in a different process than Pulumi. It's Pulumi that drives the
process by calling Besom. Therefore, you have to use functions provided by Besom for your code to have any effect.

0 comments on commit c980e84

Please sign in to comment.