# react-native-asoft-logger

> Asoft logger

Latest version **0.1.46** (published 2021-08-10) · MIT license · 0 weekly downloads

## Install

```sh
npm install react-native-asoft-logger
pnpm add react-native-asoft-logger
yarn add react-native-asoft-logger
bun add react-native-asoft-logger
```

## Health

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

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.46 |
| Published | 2021-08-10 |
| First published | 2020-09-24 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 7 |
| Unpacked size | 89.8 KB |
| Known vulnerabilities | 0 (+25 in 1 direct dependencies) |
| Install scripts | no |
| Author | Jędrzej R |
| Maintainers | jedrzej.asoft |
| Keywords | react-native, ios, android |

## Links

- npm: https://www.npmjs.com/package/react-native-asoft-logger
- Repository: https://www.npmjs.com/package/react-native-asoft-logger
- Homepage: https://www.npmjs.com/package/react-native-asoft-logger#readme
- Issues: https://www.npmjs.com/package/react-native-asoft-logger/issues
- npm.io page: https://npm.io/package/react-native-asoft-logger

## Dependencies (7)

- [axios](https://npm.io/package/axios.md) ^0.20.0
- [moment](https://npm.io/package/moment.md) ^2.29.0
- [@types/node](https://npm.io/package/@types/node.md) ^14.11.2
- [querystring](https://npm.io/package/querystring.md) ^0.2.0
- [rn-fetch-blob](https://npm.io/package/rn-fetch-blob.md) ^0.12.0
- [react-native-fs](https://npm.io/package/react-native-fs.md) ^2.16.6
- [react-native-logs](https://npm.io/package/react-native-logs.md) ^2.2.1

## Alternatives

- [@sindresorhus/slugify](https://npm.io/package/@sindresorhus/slugify.md) — 3.7M weekly downloads
- [solid-js](https://npm.io/package/solid-js.md) — 2.7M weekly downloads
- [expo-glass-effect](https://npm.io/package/expo-glass-effect.md) — 2.5M weekly downloads
- [nanoassert](https://npm.io/package/nanoassert.md) — 780.8K weekly downloads
- [@ffmpeg/ffmpeg](https://npm.io/package/@ffmpeg/ffmpeg.md) — 529.5K weekly downloads

## Recent versions

- 0.1.46 (latest) — 2021-08-10
- 0.1.45 — 2020-09-29
- 0.1.44 — 2020-09-29
- 0.1.43 — 2020-09-29
- 0.1.42 — 2020-09-29
- 0.1.41 — 2020-09-29
- 0.1.40 — 2020-09-29
- 0.1.39 — 2020-09-29
- 0.1.38 — 2020-09-29
- 0.1.37 — 2020-09-29
- 0.1.36 — 2020-09-29
- 0.1.35 — 2020-09-29
- 0.1.34 — 2020-09-29
- 0.1.33 — 2020-09-29
- 0.1.32 — 2020-09-29
- … 31 more at https://npm.io/package/react-native-asoft-logger/versions

## README

# react-native-asoft-logger

Asoft logger

## Installation

```sh
npm install react-native-asoft-logger --save
npm install react-native-fs --save
npm install rn-fetch-blob --save
```

## Example usage without logs upload feature

```js
import RNFS from 'react-native-fs';
import AL from 'react-native-asoft-logger';
import { AsoftLoggerConfig } from 'react-native-asoft-logger/lib/typescript/src/AsoftLogger';
import moment from 'moment';

const logFileSchemaDefault: string = 'gss-audit-logs-';
const gssLoggerConfig : AsoftLoggerConfig = {
  logFileSchema: logFileSchemaDefault,
  logFileName: `${logFileSchemaDefault}${moment().format('YYYY-MM-DD').toString()}`,
  internalLogsPath: `${RNFS.DocumentDirectoryPath}/asoft/gss`,
  externalLogsPath: `${RNFS.ExternalStorageDirectoryPath}/asoft/gss`,
}

const gssLogger = new AL.AsoftLogger(gssLoggerConfig);
const externalLogsPath = gssLogger.getExternalLogsPath();
export default gssLogger;

export { externalLogsPath };
```

## Example usage with logs upload feature

```js
import http from './httpService';
import RNFS from 'react-native-fs';
import AL from 'react-native-asoft-logger';
import Endpoint from './endpoints';
import { AsoftLoggerConfig } from 'react-native-asoft-logger/lib/typescript/src/AsoftLogger';
import moment from 'moment';

const logFileSchemaDefault: string = 'gsc-audit-logs-';
const trustLoggerConfig : AsoftLoggerConfig = {
  logFileSchema: logFileSchemaDefault,
  logFileName: `${logFileSchemaDefault}${moment().format('YYYY-MM-DD').toString()}`,
  internalLogsPath: `${RNFS.DocumentDirectoryPath}/asoft/gsc`,
  externalLogsPath: `${RNFS.ExternalStorageDirectoryPath}/asoft/gsc`,
}

const trustLogger = new AL.AsoftLogger(trustLoggerConfig).withUpload(http, Endpoint.Storage.GetSasTokenForAuditLogs);
const externalLogsPath = trustLogger.getExternalLogsPath();
const httpInstance = trustLogger.getHttpInstace();
const sasTokenEndpoint = trustLogger.getSasTokenEndpoint();
export default trustLogger;

export { externalLogsPath, httpInstance, sasTokenEndpoint };
```

## Contributing

See the [contributing guide](CONTRIBUTING.md) to learn how to contribute to the repository and the development workflow.

## License

MIT

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