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

Tiny docs improvements #309

Merged
merged 1 commit into from
Nov 28, 2023
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 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.