![banner](https://github.com/zubairehman/Flogs/blob/master/images/flogs-banner.png)
# FLogs Advance Logging Framework
FLog is an Advanced Logging Framework develop in flutter that provides quick & simple logging solution. All logs are saved to the DB which can then be exported as a zip file.
Overview
--------
FLogs is written in dart. It basically features two types of loggers (FLog & DataLog) with many of advanced features needed for logging. Logs are saved in database which can then be exported in document directory of Android|iOS device. The logs are helpful when developer wants to analyze user activities within the app. These logs can be filtered and sorted easily. Logs can easily be exported as zip file base on filter type, the zip file can then be uploaded to server or to use it locally.
Many times we want to log set of data to analyze certain activity e.g. Location (GPS Coordinates), Device info, Network requests etc. this helps us to quickly identify and fix the issue that is hard to debug when the app is in production. FLogs provide such functionality to log data set into database. These logs can then be fetched by applying different convinience filters availale.
Features
--------
1. Logs events in files created separately every hour with **'FLogs'** logger. (24 hours)
2. Files can be compressed and exported for time and day filters
3. Clear Logs easily
4. Save logs to custom path (Supported in Android only)
5. Export Logs to custom path as zip file (Supported in Android only)
6. Custom Log formatting
7. CSV support
8. Custom timestamps support
9. Custom data logging support with **'DataLogs'** logger.
10. Encryption support added
11. Multiple directory structures
12. Print logs as String
13. Export all or single types of logs
14. Advanced Automation for deleting logs automatically
15. Exports HTML formatted exceptions
16. Log level support
Use this package as a library
-----------------------------
**1. Depend on it**
Add this to your package's pubspec.yaml file:
```
dependencies:
f_logs: ^1.0.x
```
**2. Install it**
You can install packages from the command line:
with Flutter
```
$ flutter packages get
```
Alternatively, your editor might support flutter packages get. Check the docs for your editor to learn more.
**3. Import it**
Now in your Dart code, you can use:
```
import 'package:f_logs/f_logs.dart';
```
How to use
----------
Log files are exported on storage directory so it's very important to add these permissions to your project's manifest file first.
**Android**
```
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
```
**iOS**
```
<key>NSPhotoLibraryAddUsageDescription</key>
<string>FLogs would like to save photos from the app to your gallery</string>
<key>NSPhotoLibraryUsageDescription</key>
<string>FLogs would like to access your photo gallery for uploading images to the app</string>
```
To save logs, simply call any of the method mentioned below:
**1. Simple Trace Log**
```dart
FLog.trace(
className: "HomePage",
methodName: "_buildRow1",
text: "My log");
```
**2. Simple Debug Log**
```dart
FLog.debug(
className: "HomePage",
methodName: "_buildRow1",
text: "My log");
```
**3. Simple Info Log**
```dart
FLog.info(
className: "HomePage",
methodName: "_buildRow1",
text: "My log");
```
**4. Simple Warning Log**
```dart
FLog.warning(
className: "HomePage",
methodName: "_buildRow1",
text: "My log";
```
**5. Simple Error Log**
```dart
FLog.error(
className: "HomePage",
methodName: "_buildRow1",
text: "My log");
```
**6. Simple Severe Log**
```dart
FLog.severe(
className: "HomePage",
methodName: "_buildRow1",
text: "My log");
```
**7. Severe Log with Exception and StackTrace**
```dart
FLog.logThis(
className: "HomePage",
methodName: "_buildRow1",
text: "My log",
type: LogLevel.SEVERE,
exception: Exception("This is an Exception!"),
stacktrace: StackTrace.current);
```
**8. Simple Fatal Log**
```dart
FLog.fatal(
className: "HomePage",
methodName: "_buildRow1",
text: "My log");
```
**9. Data Type Log**
```dart
FLog.logThis(
className: "HomePage",
methodName: "_buildRow1",
text: "My log",
type: LogLevel.SEVERE,
dataLogType: DataLogType.DEVICE.toString());
```
Available Methods
-----------------
FLogs provide many convenience methods to save logs into or to fetch them from database, below is the list of all the methods available:
**1. logThis**
Logs string data along with className, methodName, logText and the type of log (LogLevel.SEVERE, LogLevel.INFO) etc. The same method can be used to log exception(s) or data logs. The difference between FLog and DataLogs is described above, you can also check out wiki for more details. If either className or methodName is not provided, it will automatically be taken by getting calling class and method.
```dart
static logThis({
String className, // This is optional if not provided, then it will automatically be taken by getting calling class
String methodName, // This is optional if not provided, then it will automatically be taken by getting calling method
@required String text,
@required LogLevel type,
Exception exception,
String dataLogType,
StackTrace stacktrace,
}){}
```
**2. trace**
Logs string data along with className, methodName, logText and the type of log (LogLevel.SEVERE, LogLevel.INFO) etc. The same method can be used to log exception(s) or data logs. If either className or methodName is not provided, it will automatically be taken by getting calling class and method.
```dart
static trace({
String className, // This is optional if not provided, then it will automatically be taken by getting calling class
String methodName, // This is optional if not provided, then it will automatically be taken by getting calling method
@required String text,
Exception exception,
String dataLogType,
StackTrace stacktrace,
}){}
```
**3. debug**
Logs string data along with className, methodName, logText and the type of log (LogLevel.SEVERE, LogLevel.INFO) etc. The same method can be used to log exception(s) or data logs. If either className or methodName is not provided, it will automatically be taken by getting calling class and method.
```dart
static debug({
String className, // This is optional if not provided, then it will automatically be taken by getting calling class
String methodName, // This is optional if not provided, then it will automatically be taken by getting calling method
@required String text,
Exception exception,
String dataLogType,
StackTrace stacktrace,
}){}
```
**4. info**
Logs string data along with className, methodName, logText and the type of log (LogLevel.SEVERE, LogLevel.INFO) etc. The same method can be used to log exception(s) or data logs. If either className or methodName is not provided, it will automatically be taken by getting calling class and method.
```dart
static info({
String className, // This is optional if not provided, then it will automatically be taken by getting calling class
String methodName, // This is optional if not provided, then it will automatically be taken by getting calling method
@required String text,
Exception exception,
String dataLogType,
StackTrace stacktrace,
}){}
```
**5. warning**
Logs string data along with className, methodName, logText and the type of log (LogLevel.SEVERE, LogLevel.INFO) etc. The same method can be used to log exception(s) or data logs. If either className or methodName is not provided, it will automatically be taken by getting calling class and method.
```dart
static warning({
String className, // This is op
没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
FLogs高级日志记录框架 FLog是在flutter中开发的高级日志记录框架,可提供快速简单的日志记录解决方案。 所有日志均保存到数据库中,然后可以将其导出为zip文件。 概述 FLogs是用Dart写的。 它基本上具有两种类型的记录器(FLog和DataLog),并具有记录所需的许多高级功能。 日志保存在数据库中,然后可以将其导出到Android | iOS设备的文档目录中。 当开发人员想要分析应用程序内的用户活动时,日志非常有用。 这些日志可以轻松过滤和排序。 可以根据过滤器类型轻松地将日志导出为zip文件,然后可以将该zip文件上传到服务器或在本地使用。 很多时候,我们希望记录数据集以分析某些活动,例如位置(GPS坐标),设备信息,网络请求等。这有助于我们快速识别和修复在应用程序投入生产时难以调试的问题。 FLog提供了将数据集记录到数据库中的功能。 然后可以通过应用不同的便捷过
资源详情
资源评论
资源推荐
收起资源包目录
Flogs-master.zip (89个子文件)
Flogs-master
.gitignore 383B
pubspec.yaml 2KB
images
flogs-banner.png 332KB
f_logs.iml 3KB
LICENSE 1KB
CHANGELOG.md 2KB
README.md 13KB
.metadata 307B
example
.gitignore 1KB
pubspec.yaml 3KB
android
app
build.gradle 2KB
src
debug
AndroidManifest.xml 335B
profile
AndroidManifest.xml 335B
main
AndroidManifest.xml 2KB
res
mipmap-xhdpi
ic_launcher.png 721B
mipmap-mdpi
ic_launcher.png 442B
mipmap-xxhdpi
ic_launcher.png 1KB
drawable
launch_background.xml 434B
mipmap-hdpi
ic_launcher.png 544B
mipmap-xxxhdpi
ic_launcher.png 1KB
values
styles.xml 361B
java
com
iotecksolutions
example
MainActivity.java 372B
settings.gradle 484B
build.gradle 470B
gradle.properties 104B
gradle
wrapper
gradle-wrapper.properties 232B
ios
Runner.xcodeproj
xcshareddata
xcschemes
Runner.xcscheme 3KB
project.xcworkspace
contents.xcworkspacedata 152B
project.pbxproj 24KB
Flutter
Release.xcconfig 108B
AppFrameworkInfo.plist 773B
Debug.xcconfig 106B
Runner
main.m 226B
AppDelegate.h 103B
Info.plist 2KB
AppDelegate.m 424B
Base.lproj
LaunchScreen.storyboard 2KB
Main.storyboard 2KB
Assets.xcassets
AppIcon.appiconset
Icon-App-40x40@3x.png 3KB
Icon-App-29x29@3x.png 2KB
Icon-App-40x40@1x.png 1KB
Icon-App-29x29@1x.png 1KB
Icon-App-20x20@1x.png 564B
Icon-App-76x76@1x.png 2KB
Contents.json 2KB
Icon-App-60x60@2x.png 3KB
Icon-App-29x29@2x.png 2KB
Icon-App-1024x1024@1x.png 11KB
Icon-App-40x40@2x.png 2KB
Icon-App-76x76@2x.png 3KB
Icon-App-20x20@2x.png 1KB
Icon-App-60x60@3x.png 4KB
Icon-App-20x20@3x.png 2KB
Icon-App-83.5x83.5@2x.png 4KB
LaunchImage.imageset
LaunchImage@2x.png 68B
LaunchImage.png 68B
LaunchImage@3x.png 68B
Contents.json 391B
README.md 336B
Podfile.lock 1KB
Podfile 2KB
Runner.xcworkspace
xcshareddata
WorkspaceSettings.xcsettings 243B
contents.xcworkspacedata 224B
README.md 540B
.metadata 303B
lib
main.dart 7KB
pubspec.lock 7KB
lib
data
local
flog_dao.dart 3KB
app_database.dart 2KB
model
datalog
data_log_type.dart 500B
flog
log_level.dart 457B
flog_config.dart 2KB
flog.dart 14KB
log.dart 1KB
f_logs.dart 968B
utils
storage
logs_storage.dart 2KB
timestamp
timestamp_format.dart 530B
formatter
field_name.dart 495B
formatter.dart 5KB
formate_type.dart 466B
filters
filters.dart 2KB
filter_type.dart 63B
encryption
xxtea.dart 2KB
datetime
date_time.dart 3KB
constants
db_constants.dart 929B
constants.dart 2KB
pubspec.lock 6KB
test
f_logs_test.dart 109B
analysis_options.yaml 194B
共 89 条
- 1
FeMnO
- 粉丝: 20
- 资源: 4609
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
评论0