Skip to content

Commit c9e91da

Browse files
committed
Bumping version to v0.9.0 + README + CHANGELOG
1 parent 3ec881b commit c9e91da

4 files changed

Lines changed: 131 additions & 4 deletions

File tree

CHANGELOG.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,29 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [0.9.0] - 2026-01-09
9+
10+
### Added
11+
- **Tracing support**: New `tracing` feature flag enables tracing/tracing-subscriber integration as an alternative to env_logger
12+
- **Configurable logging initialization**: New `log_init = function_name` macro parameter allows custom log initialization functions instead of relying on defaults
13+
- **Event logging control**: New `event_logging = bool` macro parameter controls whether Lambda event payloads are logged (defaults to `false` for better security)
14+
- Structured JSON logging by default when tracing is enabled
15+
- `#[tracing::instrument]` attributes on generated handler functions with request ID and operation name in trace spans
16+
- Signature validation for the `hook` option with clear error messages for invalid function signatures
17+
18+
### Changed
19+
- **Breaking**: Event payload logging is now disabled by default for security reasons (can be re-enabled with `event_logging = true`)
20+
- When Lambda event payloads logging is enabled, Lambda event payloads are now logged at `debug` level instead of `info`
21+
- `env_logger` is now an optional feature (still enabled by default for backward compatibility)
22+
- Independent `log` feature flag controls log statement generation in generated code
23+
24+
### Fixed
25+
- Generated `main` and `function_handler` now use fully qualified `::core::result::Result` instead of `Result`, preventing compilation failures when users override the Result type
26+
- Request hook trybuild test was not actually testing anything
27+
- Release CI could fail tests but still proceed with publishing
28+
29+
[0.9.0]: https://github.com/JeremieRodon/lambda-appsync/compare/v0.8.0...v0.9.0
30+
831
## [0.8.0] - 2025-11-16
932

1033
### Changed

Cargo.lock

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ members = ["lambda-appsync", "lambda-appsync-proc"]
33
resolver = "2"
44

55
[workspace.package]
6-
version = "0.8.0"
6+
version = "0.9.0"
77
rust-version = "1.82.0"
88
edition = "2021"
99
authors = ["Jérémie RODON <jeremie.rodon@gmail.com>"]

README.md

Lines changed: 105 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ The lambda-appsync crate provides procedural macros that convert GraphQL schemas
2020
- 📦 Performance-optimized batching support
2121
- 🛡️ Flexible request validation hooks (e.g. for advanced authentication flows)
2222
- 🔐 Comprehensive support for all AWS AppSync auth types
23+
- 📊 Configurable logging with support for either `env_logger` and `tracing` (or both!)
24+
- 🔧 Custom log initialization functions
2325

2426
## Known limitations
2527

@@ -37,7 +39,7 @@ Add this dependency to your `Cargo.toml`:
3739

3840
```toml
3941
[dependencies]
40-
lambda-appsync = "0.8.0"
42+
lambda-appsync = "0.9.0"
4143
```
4244

4345
## Quick Start
@@ -253,6 +255,87 @@ async fn store_item(item: Item, client: &aws_sdk_dynamodb::Client) -> Result<(),
253255

254256
Error types and messages are extracted from AWS SDK error metadata, allowing use of the `?` operator with AWS SDK calls for properly formatted AppSync response errors.
255257

258+
### Logging Configuration
259+
260+
The framework provides flexible logging configuration with support for both `env_logger` (default) and `tracing`.
261+
262+
#### Default Logging (env_logger)
263+
264+
By default, lambda-appsync uses `env_logger`:
265+
266+
```rust
267+
appsync_lambda_main!(
268+
"graphql/schema.gql",
269+
dynamodb() -> aws_sdk_dynamodb::Client,
270+
);
271+
```
272+
273+
#### Custom Log Initialization
274+
275+
Override the default logging setup with a custom function:
276+
277+
```rust
278+
fn custom_log_init() {
279+
use lambda_appsync::env_logger;
280+
env_logger::Builder::from_env(
281+
env_logger::Env::default()
282+
.default_filter_or("info,tracing::span=warn")
283+
.default_write_style_or("never"),
284+
)
285+
.format_timestamp_micros()
286+
.init();
287+
}
288+
289+
appsync_lambda_main!(
290+
"graphql/schema.gql",
291+
log_init = custom_log_init,
292+
dynamodb() -> aws_sdk_dynamodb::Client,
293+
);
294+
```
295+
296+
#### Tracing Support
297+
298+
Enable structured JSON logging with tracing by adding the `tracing` feature:
299+
300+
```toml
301+
[dependencies]
302+
lambda-appsync = { version = "0.9.0", default-features = false, features = ["tracing"] }
303+
```
304+
305+
```rust
306+
fn tracing_init() {
307+
use lambda_appsync::{tracing, tracing_subscriber};
308+
tracing_subscriber::fmt()
309+
.json()
310+
.with_env_filter(
311+
tracing_subscriber::EnvFilter::from_default_env()
312+
.add_directive(tracing::Level::INFO.into()),
313+
)
314+
.with_current_span(false)
315+
.with_ansi(false)
316+
.with_target(false)
317+
.init();
318+
}
319+
320+
appsync_lambda_main!(
321+
"graphql/schema.gql",
322+
log_init = tracing_init,
323+
dynamodb() -> aws_sdk_dynamodb::Client,
324+
);
325+
```
326+
327+
#### Event Logging Control
328+
329+
Control whether Lambda event payloads are logged (disabled by default for security):
330+
331+
```rust
332+
appsync_lambda_main!(
333+
"graphql/schema.gql",
334+
event_logging = true, // Enable full event payload logging for debugging
335+
dynamodb() -> aws_sdk_dynamodb::Client,
336+
);
337+
```
338+
256339
### Error Merging
257340

258341
Combine multiple errors using the pipe operator:
@@ -262,6 +345,27 @@ let err = AppsyncError::new("ValidationError", "Invalid email")
262345
| AppsyncError::new("DatabaseError", "User not found");
263346
```
264347

348+
### Feature Flags
349+
350+
The `lambda-appsync` crate supports several feature flags for different use cases:
351+
352+
- `env_logger` (default): Enables env_logger integration and re-exports
353+
- `tracing`: Enables tracing/tracing-subscriber integration as an alternative to env_logger
354+
- `log`: Controls log statement generation in generated code and availability of re-exported `log` crate
355+
356+
You can mix and match these features based on your needs:
357+
358+
```toml
359+
# Use tracing instead of env_logger
360+
lambda-appsync = { version = "0.9.0", default-features = false, features = ["tracing"] }
361+
362+
# Use both (for migration scenarios)
363+
lambda-appsync = { version = "0.9.0", features = ["tracing"] }
364+
365+
# Use your custom logging framework while still getting logs from the macro-generated code
366+
lambda-appsync = { version = "0.9.0", default-features = false, features = ["log"] }
367+
```
368+
265369
## Minimum Supported Rust Version (MSRV)
266370

267371
This crate requires Rust version 1.82.0 or later.

0 commit comments

Comments
 (0)