@open-kingdom/shared-frontend-data-access-logger 0.0.2-0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +29 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +1442 -0
- package/dist/lib/console-listener.d.ts +2 -0
- package/dist/lib/console-listener.d.ts.map +1 -0
- package/dist/lib/logger.actions.d.ts +15 -0
- package/dist/lib/logger.actions.d.ts.map +1 -0
- package/dist/lib/logger.middleware.d.ts +3 -0
- package/dist/lib/logger.middleware.d.ts.map +1 -0
- package/dist/lib/logger.selectors.d.ts +118 -0
- package/dist/lib/logger.selectors.d.ts.map +1 -0
- package/dist/lib/logger.slice.d.ts +9 -0
- package/dist/lib/logger.slice.d.ts.map +1 -0
- package/dist/lib/logger.types.d.ts +20 -0
- package/dist/lib/logger.types.d.ts.map +1 -0
- package/package.json +32 -0
package/README.md
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# data-access-logger
|
|
2
|
+
|
|
3
|
+
This library provides data access infrastructure for logging functionality. It handles log persistence, transmission, and state management for application logging.
|
|
4
|
+
|
|
5
|
+
## Features
|
|
6
|
+
|
|
7
|
+
- Redux slice for log state management
|
|
8
|
+
- Action creators for different log levels (info, warn, error)
|
|
9
|
+
- Selectors for querying log data
|
|
10
|
+
- Middleware for side effects (console logging, custom handlers)
|
|
11
|
+
- TypeScript support with proper typing
|
|
12
|
+
|
|
13
|
+
## Usage
|
|
14
|
+
|
|
15
|
+
```typescript
|
|
16
|
+
import { logInfo, logWarn, logError, selectLogs } from '@open-kingdom/shared-frontend-data-access-logger';
|
|
17
|
+
|
|
18
|
+
// Dispatch log actions
|
|
19
|
+
dispatch(logInfo('User logged in'));
|
|
20
|
+
dispatch(logWarn('API rate limit approaching'));
|
|
21
|
+
dispatch(logError('Database connection failed'));
|
|
22
|
+
|
|
23
|
+
// Query log data
|
|
24
|
+
const logs = useSelector(selectLogs);
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## Running unit tests
|
|
28
|
+
|
|
29
|
+
Run `nx test data-access-logger` to execute the unit tests via [Jest](https://jestjs.io).
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,sBAAsB,CAAC;AACrC,cAAc,wBAAwB,CAAC;AACvC,cAAc,oBAAoB,CAAC;AACnC,cAAc,yBAAyB,CAAC"}
|