All Projects → PlugFox → l

PlugFox / l

Licence: WTFPL license
Cross-platform html/io [L]ogger with simple API.

Programming Languages

dart
5743 projects
HTML
75241 projects
Makefile
30231 projects

Projects that are alternatives of or similar to l

Flogs
An Advanced Logging Framework develop in flutter that provides quick & simple logging solution.
Stars: ✭ 158 (+507.69%)
Mutual labels:  logger, logs, logging-library, dart-library, dart-package
LogDNA-Android-Client
Android client for LogDNA
Stars: ✭ 22 (-15.38%)
Mutual labels:  log, logger, logs, logging-library
JJSwiftLog
Swift log library for all platform
Stars: ✭ 51 (+96.15%)
Mutual labels:  log, logger, logging-library
ratlog.js
🐀 Ratlog JavaScript library - Application Logging for Rats, Humans and Machines
Stars: ✭ 24 (-7.69%)
Mutual labels:  logger, logs, logging-library
Golog
A high-performant Logging Foundation for Go Applications. X3 faster than the rest leveled loggers.
Stars: ✭ 208 (+700%)
Mutual labels:  log, logger, logs
Gollum
An n:m message multiplexer written in Go
Stars: ✭ 883 (+3296.15%)
Mutual labels:  log, logger, logs
PoShLog
🔩 PoShLog is PowerShell cross-platform logging module. It allows you to log structured event data into console, file and much more places easily. It's built upon great C# logging library Serilog - https://serilog.net/
Stars: ✭ 108 (+315.38%)
Mutual labels:  log, logger, logs
clue
a extremely high performance log library for android. 高性能的Android日志库
Stars: ✭ 27 (+3.85%)
Mutual labels:  log, logger, logging-library
ptkdev-logger
🦒 Beautiful Logger for Node.js: the best alternative to the console.log statement
Stars: ✭ 117 (+350%)
Mutual labels:  log, logger, logs
Cocoadebug
iOS Debugging Tool 🚀
Stars: ✭ 3,769 (+14396.15%)
Mutual labels:  log, logger, logging-library
Serverless Es Logs
A Serverless plugin to transport logs to ElasticSearch
Stars: ✭ 51 (+96.15%)
Mutual labels:  log, logger, logs
log
Aplus Framework Log Library
Stars: ✭ 14 (-46.15%)
Mutual labels:  log, logger
ng-logger
Angular logger service
Stars: ✭ 65 (+150%)
Mutual labels:  log, logger
flutter sliding tutorial
User onboarding library with smooth animation of objects and background colors
Stars: ✭ 127 (+388.46%)
Mutual labels:  dart-library, dart-package
datalogger
DataLogger foi projetado para ser uma biblioteca simples de log com suporte a vários providers.
Stars: ✭ 46 (+76.92%)
Mutual labels:  log, logger
palace
server side framework for dart inspired by express.js
Stars: ✭ 32 (+23.08%)
Mutual labels:  dart-library, dart-package
RxLogs
An Android & Kotlin Reactive Advanced Logging Framework.
Stars: ✭ 12 (-53.85%)
Mutual labels:  logger, logging-library
dart-tags
ID3 Tag parser written on the pure dart language.
Stars: ✭ 35 (+34.62%)
Mutual labels:  pub, dart-library
logops
Really simple and performant logger for node projects compatible with any kind of deployments as your server operations/environment defined
Stars: ✭ 20 (-23.08%)
Mutual labels:  logger, logs
bloc
A predictable state management library that helps implement the BLoC design pattern
Stars: ✭ 12 (-53.85%)
Mutual labels:  pub, dart-library

[L]ogger

Pub Logger Coverage License: WTFPL Linter

About

Cross-platform html/io logger with simple API.
No need to create an logger object. Just import and use. Simple and w/o boilerplate.
Work with native console.


Core API

Key features

Method Description
[s] A shout is always displayed
[v1], [v] Regular message with verbose level 1
[e] Error message with verbose level 1
[v2], [vv] Regular message with verbose level 2
[w] Warning message with verbose level 2
[v3], [vvv] Regular message with verbose level 3
[i], [<] Inform message with verbose level 3
[v4], [vvvv] Regular message with verbose level 4
[d], [<<] Debug message with verbose level 4
[v5], [vvvvv] Regular message with verbose level 5
[v6], [vvvvvv] Regular message with verbose level 6
l.s('shout me');
l.e('error msg');
l.w('warning msg');
l.i('info msg');
l < 'alt info msg';
l.d('debug msg');
l << 'alt debug msg';
l.v('verbose lvl #1');
l.vv('verbose lvl #2');
l.vvv('verbose lvl #3');
l.v4('verbose lvl #4');
l.v5('verbose lvl #5');
l.v6('verbose lvl #6');

Integration capabilities

Method Description
[listen] Broadcast stream receiving logs.
// Broadcast stream instantly receiving logs.
l.forEach((log) => print('* ${log.level} : ${log.message}'));

Print handling and customizing

Logger supports fine-tuning with second argument LogOptions in l.capture method. Also, you can handle print and output with l on some function or in a whole app with this simple syntax:

import 'package:l/l.dart';

void main() => l.capture(
      someFunction,
      const LogOptions(
        handlePrint: true,
        printColors: true,
        outputInRelease: false,
        messageFormatting: _messageFormatting,
      ),
    );

Future<void> someFunction() async {
  print('Hello');
  await Future<void>.delayed(const Duration(milliseconds: 150));
  l.d('world');
  await Future<void>.delayed(const Duration(milliseconds: 150));
  l.e('!!!');
}

Object _messageFormatting(Object message, LogLevel logLevel, DateTime now) =>
    '${now.hour}:${now.minute.toString().padLeft(2, '0')} $message';

Handling errors

Flutter

final sourceFlutterError = FlutterError.onError;
FlutterError.onError = (details) {
  l.w(details.exceptionAsString(), details.stack);
  sourceFlutterError?.call(details);
};

Crashlytics

l.where((msg) => msg.level.maybeWhen(
      error: () => true,
      warning: () => true,
      orElse: () => false,
    ))
  .map<String>((msg) => msg.message.toString())
  .listen(FirebaseCrashlytics.instance.log);

Zoned Errors

runZonedGuarded(someFunction, l.e);  

Handling uncaught errors

Isolate.current
       ..setErrorsFatal(false)
       ..addErrorListener(
         RawReceivePort(
           (List<dynamic> pair) => // ignore: avoid_types_on_closure_parameters
               l.e(pair.first as Object),
         ).sendPort,
       );

Output example


Limitations

  • When there is no direct access to the terminal, it works through print.
  • !!! PLEASE, DO NOT LOG SENSITIVE INFORMATION !!!

Changelog

Refer to the Changelog to get all release notes.


Maintainers

Plague Fox


License

WTFPL


Tags

logger, log, logs, logging, logging-library, cross-platform, io, html

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].