All Projects → alinz → react-native-logger

alinz / react-native-logger

Licence: other
Async aware logger for react-native with grouping and filter feature

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to react-native-logger

Xlog
Android logger, pretty, powerful and flexible, log to everywhere, save to file, all you want is here.
Stars: ✭ 2,468 (+12240%)
Mutual labels:  logger, filter
loggin-js
📝 Customizable and expandable logger for Node.js
Stars: ✭ 20 (+0%)
Mutual labels:  logger, filter
fancy-logs
Print fancy logs to the terminal
Stars: ✭ 14 (-30%)
Mutual labels:  logger
KeePassSubsetExport
KeePassSubsetExport is a KeePass2 plugin which automatically exports a subset of entries to new databases
Stars: ✭ 39 (+95%)
Mutual labels:  filter
Flogs
An Advanced Logging Framework develop in flutter that provides quick & simple logging solution.
Stars: ✭ 158 (+690%)
Mutual labels:  logger
BaseDevelop
an android project for now fashion open source framework
Stars: ✭ 24 (+20%)
Mutual labels:  logger
xray
Hexrays decompiler plugin that colorizes and filters the decompiler's output based on regular expressions
Stars: ✭ 97 (+385%)
Mutual labels:  filter
logi-filter-builder
advanced SQL filter builder. Demo:
Stars: ✭ 23 (+15%)
Mutual labels:  filter
logger
All you need to log with Bref on AWS Lambda.
Stars: ✭ 30 (+50%)
Mutual labels:  logger
YaLafi
Yet another LaTeX filter
Stars: ✭ 50 (+150%)
Mutual labels:  filter
Filmroom
A Image Processing test field of Apple Platform. Mainly using Swift and Metal
Stars: ✭ 42 (+110%)
Mutual labels:  filter
express-mquery
Expose mongoose query API through HTTP request.
Stars: ✭ 37 (+85%)
Mutual labels:  filter
HttpFilteringEngine
Transparent filtering TLS proxy.
Stars: ✭ 48 (+140%)
Mutual labels:  filter
pandoc-latex-environment
Pandoc filter for adding LaTeX environement on specific div
Stars: ✭ 27 (+35%)
Mutual labels:  filter
linq
A familiar set of functions that operate on JavaScript iterables (ES2015+) in a similar way to .NET's LINQ does with enumerables.
Stars: ✭ 39 (+95%)
Mutual labels:  filter
activeadmin-ajax filter
AJAX filters for ActiveAdmin
Stars: ✭ 86 (+330%)
Mutual labels:  filter
forcelog
A structured, extensible logger for Salesforce Apex
Stars: ✭ 37 (+85%)
Mutual labels:  logger
handlers
Go's HTTP handlers I use in my projects
Stars: ✭ 53 (+165%)
Mutual labels:  logger
puts debuggerer
Ruby library for improved puts debugging, automatically displaying bonus useful information such as source line number and source code.
Stars: ✭ 82 (+310%)
Mutual labels:  logger
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 (+440%)
Mutual labels:  logger

React-Native-Logger

Sync or Async Aware logger for react-native

This Project address couple of issues

  • Simple to use
  • Group logs
  • Filter Logs by name
  • Async aware

Installation (NPM or Yarn)

npm install react-native-logger --save
yarn add react-native-logger

Usage

import { logger } from 'react-native-logger'

There are 3 functions.

log: (...args: Array) => void

similar to console.log. for example

logger.log('this is awesome', 10, 10)

// logs as
// this is awesome 10 10

group: (name: string, title: string, log: LogFn) => void

it accepts 3 arguments. name is an identifier which you can use in setFilters. title is a simple description about the log it self. and log is a function which your loggin happening. The signiture of LogFn is

type LogFn: (log: (...args: Array<any>) => void) => void | Promise<any>

It basically group related logs into one. also you can return a promise which cause the logs waits until you tell it so.

logger.group('api', 'loads users list', async (log) => {
  
  const users = await apis.getAllUsers();

  log('list of users', users);

  actions.updateUsersList(users);
});

setFilters: (...names: Array): void

simply filters out everything except those names that you pass to logs. to clear the filter simply call it without arguments.

logger.filters('api')

cheers,

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].