Codenic Clean Architecture
  • Introduction
  • The Clean Architecture
    • Presentation Layer
    • Domain Layer
    • Infrastructure Layer
  • Tutorial
    • Overview
    • Creating a Flutter Modular Project
      • Tips for Managing a Modular Project
    • Implementing the Domain Layer
      • Core Dependencies
      • Creating an Entity
      • Creating a Failure
      • Creating a Repository Interface
      • Creating Use Cases
        • CRUD Operations (Runner)
        • Data Streams (Watcher)
    • Implementing the Infrastructure Layer
      • External Dependencies
      • Creating a Data Model
      • Creating a Data Source
      • Implementing a Repository
    • Implementing the Presentation Layer
      • External Dependencies
      • Dependency Injection and Service Locator
      • Widgets
        • Snackbar Handler
        • Global Blocs Widget
        • Note Widgets
  • Packages
    • Codenic Bloc Use Case
      • Runner
      • Watcher
    • Codenic Logger
      • Usage
      • Example
      • Modifying the Logger
      • Integrating Firebase Crashlytics to the logger
    • Codenic Exception Converter
      • Failure Object
      • Exception Converter
      • Exception Converter Suite
      • Example
Powered by GitBook
On this page
  1. Packages
  2. Codenic Logger

Modifying the Logger

PreviousExampleNextIntegrating Firebase Crashlytics to the logger

Last updated 2 years ago

The CodenicLogger is an extension of the package. This means that it has same parameters as its parent, specifically the , , and . These parameters can be modified when the CodenicLogger is instantiated.

With regards to the printer, the CodenicLogger can only accept a special printer called MessageLogPrinter which enforces a fixed structure for the printed logs.

/// CODE FORKED FROM https://pub.dev/packages/logger#options    

final codenicLogger = CodenicLogger(
  filter: null, // Use the default LogFilter (-> only log in debug mode)
  output: null, // Use the default LogOutput (-> send everything to console)
  printer: MessageLogPrinter(
    methodCount: 2, // number of method calls to be displayed
    errorMethodCount: 8, // number of method calls if stacktrace is provided
    lineLength: 120, // width of the output
    colors: true, // Colorful log messages
    printEmojis: true, // Print an emoji for each log message
    printTime: false // Should each log print contain a timestamp
    stackTraceBlocklist: [ // Blocklists the stack trace lines that matches any of the regex
      RegExp('package:codenic_logger/'),
      RegExp('package:codenic_bloc_use_case/'),
    ],
  ),
);
logger
LogLevel
LogFilter
LogOutput