custom-logger
所属分类:图形图像处理
开发工具:Dart
文件大小:0KB
下载次数:0
上传日期:2024-02-14 07:05:52
上 传 者:
sh-1993
说明: 一个全面的Dart项目,包括用于增强控制台输出格式的自定义记录器功能。它提供了设置日志级别、颜色代码、前缀、后缀等选项,允许定制日志行为。
(A comprehensive Dart project that includes custom logger functionality for enhanced console output formatting. It provides options to set log levels, color codes, prefixes, suffixes, and more, allowing for tailored logging behavior.)
文件列表:
lib/
test/
CHANGELOG.md
LICENSE
analysis_options.yaml
metadata
pubspec.yaml
# Custom Logger Library
The Custom Logger Library provides flexible logging functionalities for Dart applications, enabling customized console output with enhanced formatting and color-coded messages.
## Features
- **Color Formatting**: Customize log messages with various colors for improved readability.
- **Log Level Configuration**: Set different log levels and prefixes for information, errors, warnings, and successes.
- **Customizable Output**: Define total line lengths, characters for filling, dividers, and more for tailored log formatting.
## Installation
Add the following line to your `pubspec.yaml`:
```yaml
dependencies:
custom_logger: ^1.0.0 # Replace with the latest version
```
Then, run:
```bash
$ flutter pub get
```
## Usage
Import the library:
```dart
import 'package:custom_logger/custom_logger.dart';
```
Initialize the logger:
```dart
final logger = CustomLogger.instance;
```
Customize logging options:
```dart
CustomLogger.setInfoPrefixAndSuffix('');
CustomLogger.setErrorPrefixAndSuffix('');
```
Use the logger:
```dart
CustomLogger.info('This is an information message');
CustomLogger.error('This is an error message');
CustomLogger.success('This is a success message');
CustomLogger.warning('This is a warning message');
```
## Configuration Options
The library provides several configuration options, including:
- `setInfoPrefixAndSuffix`
- `setErrorPrefixAndSuffix`
- `setSuccessPrefixAndSuffix`
- `setWarningPrefixAndSuffix`
- `setLineBreaksAfterLog`
- `toggleCallerInfo`
- `setInfoTitle`
- `setErrorTitle`
- `setSuccessTitle`
- `setWarningTitle`
- and more...
Check the [API documentation](https://github.com/LFebruary/custom-logger/blob/master/doc/api/index.html) for detailed information on available methods and their usage.
## Examples
For more advanced usage and specific scenarios, refer to the examples provided in the [`/example`](https://github.com/LFebruary/custom-logger/blob/master/link/to/examples) directory.
## Issues and Feedback
Please report any issues or provide feedback on the [GitHub repository](https://github.com/LFebruary/custom-logger/blob/master/https://github.com/LFebruary/custom-logger/issues).
## License
This project is licensed under the [MIT License](https://github.com/LFebruary/custom-logger/blob/master/link/to/license).
近期下载者:
相关文件:
收藏者: