Commit 6c184c3 1 parent 16e340b commit 6c184c3 Copy full SHA for 6c184c3
File tree 2 files changed +18
-3
lines changed
2 files changed +18
-3
lines changed Original file line number Diff line number Diff line change @@ -78,6 +78,7 @@ You can find its changes [documented below](#070---2021-01-01).
78
78
- ` Event::WindowScale ` to notify widgets of the window's scale changes. ([ #2335 ] by [ @xStrom ] )
79
79
- ` Ctx::scale ` method to all contexts for widgets to easily access the window's scale. ([ #2335 ] by [ @xStrom ] )
80
80
- Add a public constructor to ` StringCursor ` ([ #2319 ] by [ @benoitryder ] )
81
+ - App: add start_console_logging(bool) which accepts a flag. ([ #2102 ] by [ @ratmice ] )
81
82
82
83
### Changed
83
84
@@ -580,6 +581,7 @@ Last release without a changelog :(
580
581
[ @benoitryder ] : https://github.com/benoitryder
581
582
[ @sprocklem ] : https://github.com/sprocklem
582
583
[ @cbondurant ] : https://github.com/cbondurant
584
+ [ @ratmice ] : https://github.com/ratmice
583
585
584
586
[ #599 ] : https://github.com/linebender/druid/pull/599
585
587
[ #611 ] : https://github.com/linebender/druid/pull/611
@@ -863,6 +865,7 @@ Last release without a changelog :(
863
865
[ #2036 ] : https://github.com/linebender/druid/pull/2036
864
866
[ #2064 ] : https://github.com/linebender/druid/pull/2064
865
867
[ #1979 ] : https://github.com/linebender/druid/pull/1979
868
+ [ #2102 ] : https://github.com/linebender/druid/pull/2102
866
869
[ #2119 ] : https://github.com/linebender/druid/pull/2119
867
870
[ #2111 ] : https://github.com/linebender/druid/pull/2111
868
871
[ #2117 ] : https://github.com/linebender/druid/pull/2117
Original file line number Diff line number Diff line change @@ -190,9 +190,17 @@ impl<T: Data> AppLauncher<T> {
190
190
///
191
191
/// # Panics
192
192
///
193
- /// Panics if the subscriber fails to initialize, for example if a `tracing`/`tracing_wasm`
194
- /// global logger was already set.
195
- pub fn log_to_console ( self ) -> Self {
193
+ /// Panics if `enable` is `true` and the subscriber fails to initialize,
194
+ /// for example if a `tracing`/`tracing_wasm` global logger was already set.
195
+ ///
196
+ /// Never panics when `enable` is `false`, or have any other side effect.
197
+ ///
198
+ /// Passing in false is useful if you want to enable a global logger as feature
199
+ /// but log to console otherwise.
200
+ pub fn start_console_logging ( self , enable : bool ) -> Self {
201
+ if !enable {
202
+ return self ;
203
+ }
196
204
#[ cfg( not( target_arch = "wasm32" ) ) ]
197
205
{
198
206
use tracing_subscriber:: prelude:: * ;
@@ -219,6 +227,10 @@ impl<T: Data> AppLauncher<T> {
219
227
self
220
228
}
221
229
230
+ /// Calls `start_console_logging` with `true`.
231
+ pub fn log_to_console ( self ) -> Self {
232
+ self . start_console_logging ( true )
233
+ }
222
234
/// Use custom localization resource
223
235
///
224
236
/// `resources` is a list of file names that contain strings. `base_dir`
You can’t perform that action at this time.
0 commit comments