# react-native-log-screen

> Print log for a separate screen for React Native

Latest version **1.0.4** (published 2021-08-11) · MIT license · 0 weekly downloads

## Install

```sh
npm install react-native-log-screen
pnpm add react-native-log-screen
yarn add react-native-log-screen
bun add react-native-log-screen
```

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.4 |
| Published | 2021-08-11 |
| First published | 2021-03-24 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 8 |
| Unpacked size | 652.7 KB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| Author | Zachary |
| Maintainers | vurtnec |
| Keywords | log, logs, logger, react-native, file, custom, levels, console, debug |

## Links

- npm: https://www.npmjs.com/package/react-native-log-screen
- npm.io page: https://npm.io/package/react-native-log-screen

## Dependencies (8)

- [rxjs](https://npm.io/package/rxjs.md) ^6.6.6
- [uuid](https://npm.io/package/uuid.md) ^8.3.2
- [realm](https://npm.io/package/realm.md) 10.2.0
- [lodash](https://npm.io/package/lodash.md) ^4.17.20
- [moment](https://npm.io/package/moment.md) ^2.29.1
- [debounce](https://npm.io/package/debounce.md) ^1.2.0
- [@types/uuid](https://npm.io/package/@types/uuid.md) ^8.3.0
- [@types/lodash](https://npm.io/package/@types/lodash.md) ^4.14.165

## Alternatives

- [cli-color](https://npm.io/package/cli-color.md) — 3.4M weekly downloads
- [log](https://npm.io/package/log.md) — 1.3M weekly downloads
- [logstash-client](https://npm.io/package/logstash-client.md) — 4.5K weekly downloads
- [@nocobase/plugin-logger](https://npm.io/package/@nocobase/plugin-logger.md) — 2.0K weekly downloads
- [child-process-debug](https://npm.io/package/child-process-debug.md) — 695 weekly downloads

## Recent versions

- 1.0.4 (latest) — 2021-08-11
- 1.0.3 — 2021-08-11
- 1.0.2 — 2021-08-06
- 1.0.1 — 2021-03-25
- 1.0.0 — 2021-03-24

## README

# Features

* Colored logging to your console and easy to integration in your customerized component. 

* Different log levels

* Log in Memory/Storage

* Using Rxjs observer and subscriber to track logs.


# Usage

1. Initial logger only once when your application init.

```typescript
    LoggerFactory.createLogger({
            logToConsole:true
     },
    LOG_STORAGE_TYPE.LOCALSTORAGE)

``` 
LOG_STORAGE_TYPE can be LOCALSTORAGE & MEMORY

* LoggerOptions can be use to integration other log instance, please use logToConsoleFunc as logger callback.
  
```typescript
     LoggerOptions {
        logToConsole: boolean
        logToConsoleFunc?: (message: any, ...optionalParams: any[]) => void
    }
```

2. Use logger
* Initial LoggerFactory
* Subscribe logger
E.g
```typescript
   logger.subscribe(message => {
         // eslint-disable-next-line react/no-access-state-in-setstate
         this.setState({ logData: [...this.state.logData, message] })
       })
   ```
   * Use logger the same as console.log logger.debug() logger.info() etc. 


3. Example
   Please refer to LoggerPage.ts

---
_Source: https://npm.io/package/react-native-log-screen · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
