This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:fimber/fimber.dart'; | |
import 'package:fimber_io/fimber_io.dart'; | |
import 'package:flutter/widgets.dart'; | |
import 'package:path_provider/path_provider.dart'; | |
// setting tag for the whole app | |
FimberLog logger = FimberLog("flutter_log_fimber"); | |
Fimber plantMeDebug() { | |
Fimber.plantTree(DebugTree.elapsed(useColors: true)); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void main() async { | |
// timing and colors defined in function | |
plantMeDebug(); | |
// ignore: no-empty-block | |
if (kIsWeb) { | |
// running on the web! | |
} else { | |
await plantFileTree(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Copyright(c) 2021 Fredrick Allan Grott. All rights reserved. | |
// Use of this source code is governed by a BSD-style license. | |
import 'package:flutter/foundation.dart'; | |
/// isInDebugMode is a function that provides a bool indicating whether in | |
/// the flutter build mode of debug or not. | |
/// @author Fredrick Allan Grott | |
bool get isInDebugMode { | |
bool _inDebugMode = false; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Copyright(c) 2021 Fredrick Allan Grott. All rights reserved. | |
// Use of this source code is governed by a BSD-style license. | |
import 'dart:async'; | |
import 'dart:core'; | |
import 'dart:developer'; | |
import 'package:flutter/foundation.dart'; | |
import 'package:flutter/material.dart'; | |
import 'package:flutter_app_exceptions/build_modes.dart'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:ansicolor/ansicolor.dart'; | |
final penFinest = AnsiPen() | |
..white(bold: true) | |
..rgb(r: 0, g: 0, b: 153, bg: true); | |
final penFiner = AnsiPen() | |
..black(bold: true) | |
..rgb(r: 255, g: 255, b: 255, bg: true); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:base_riverpod/app/utils/build_modes.dart'; | |
import 'package:base_riverpod/app/utils/logging/log_pens.dart'; | |
import 'package:logging/logging.dart'; | |
import 'package:logging_appenders/logging_appenders.dart'; | |
import 'package:simple_logger/simple_logger.dart'; | |
final logger = SimpleLogger(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:logging/logging.dart'; | |
abstract class LoggerType { | |
Logger get logger; | |
} | |
extension LoggerSpawner on LoggerType{ | |
Logger newLogger(String name) => Logger('${logger.fullName}.$name'); | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:base_riverpod/app/utils/logging/types.dart'; | |
import 'package:logging/logging.dart'; | |
// Works by setting the logger instance that we get in the class | |
// calling the mixin with a specific string name and thus allows | |
// a flexible setting what attributes of: | |
// error(cause) | |
// stackTrace | |
// level via logger suffix of finest, finer, fine, info, config, | |
// warning, severe, shout |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'dart:async'; | |
import 'dart:developer'; | |
import 'package:base_riverpod/app/utils/logging/log_pens.dart'; | |
/// To make sure that we collect all expected and unexpected exceptions we |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class CounterNotifier extends StateNotifier<CounterModel> with UtilityLogger { | |
CounterNotifier() : super(_initialValue); | |
static const _initialValue = CounterModel(0); | |
void increment() { | |
state = CounterModel(state.count + 1); | |
// log our state change | |
//myAppLog("count increased by 1"); | |
logger.info(penInfo("count increased by 1")); |