Problem
The generated vaden_application.dart uses raw print(e) and print(stack) in the global exception handler:
// vaden_application.dart (auto-generated)
} catch (e, stack) {
print(e);
print(stack);
return _handleException(e);
}
This produces noisy, unformatted stack traces for every caught exception — including expected ones like auth failures (400/401). In production, this clutters logs and makes it hard to distinguish real errors from normal flow.
Proposed Solution
Use the official logging package (by dart.dev) instead of print():
import 'package:logging/logging.dart';
final _logger = Logger('VadenApp');
// ...
} catch (e, stack) {
_logger.severe('Unhandled exception', e, stack);
return _handleException(e);
}
Benefits
- Structured output — timestamps, log levels, and source names
- Filterable — users can set log levels to suppress noise
- Consistent — aligns with Dart ecosystem standard (
logging has 5M+ downloads)
- Configurable — apps can attach their own log handlers (file, remote, formatted console)
Alternative
At minimum, skip printing stack traces for exceptions handled by @ControllerAdvice (e.g., ResponseException, DioException), since those are expected application errors, not crashes.
Environment
- Vaden: 1.0.2
- Dart SDK: 3.10
Problem
The generated
vaden_application.dartuses rawprint(e)andprint(stack)in the global exception handler:This produces noisy, unformatted stack traces for every caught exception — including expected ones like auth failures (400/401). In production, this clutters logs and makes it hard to distinguish real errors from normal flow.
Proposed Solution
Use the official
loggingpackage (bydart.dev) instead ofprint():Benefits
logginghas 5M+ downloads)Alternative
At minimum, skip printing stack traces for exceptions handled by
@ControllerAdvice(e.g.,ResponseException,DioException), since those are expected application errors, not crashes.Environment