@abapify/logger 0.0.0 → 0.3.4

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.
Files changed (2) hide show
  1. package/README.md +61 -1
  2. package/package.json +33 -3
package/README.md CHANGED
@@ -1,3 +1,63 @@
1
1
  # @abapify/logger
2
2
 
3
- Placeholder. The real release is published via CI/CD.
3
+ [![version](https://img.shields.io/github/package-json/v/abapify/adt-cli?filename=packages/logger/package.json)](https://github.com/abapify/adt-cli/pkgs/npm/%40abapify%2Flogger)
4
+
5
+ Shared logger interface for `@abapify` packages.
6
+
7
+ ## Overview
8
+
9
+ This package defines the `Logger` interface used across all abapify packages. It is compatible with [pino](https://getpino.io/), winston, bunyan, and any other logger that exposes a standard log-level API.
10
+
11
+ ## Installation
12
+
13
+ ```bash
14
+ npm install @abapify/logger
15
+ ```
16
+
17
+ ## Usage
18
+
19
+ ### Accept the interface in your package
20
+
21
+ ```typescript
22
+ import type { Logger } from '@abapify/logger';
23
+
24
+ export function createMyService(logger: Logger) {
25
+ logger.info('Service started');
26
+ logger.debug('Detail', { key: 'value' });
27
+ }
28
+ ```
29
+
30
+ ### Use the no-op logger in tests
31
+
32
+ ```typescript
33
+ import { noopLogger } from '@abapify/logger';
34
+
35
+ const service = createMyService(noopLogger);
36
+ ```
37
+
38
+ ### Use pino in production
39
+
40
+ ```typescript
41
+ import pino from 'pino';
42
+ import type { Logger } from '@abapify/logger';
43
+
44
+ const logger: Logger = pino();
45
+ ```
46
+
47
+ ## Interface
48
+
49
+ ```typescript
50
+ interface Logger {
51
+ trace(msg: string, obj?: any): void;
52
+ debug(msg: string, obj?: any): void;
53
+ info(msg: string, obj?: any): void;
54
+ warn(msg: string, obj?: any): void;
55
+ error(msg: string, obj?: any): void;
56
+ fatal(msg: string, obj?: any): void;
57
+ child(bindings: Record<string, any>): Logger;
58
+ }
59
+ ```
60
+
61
+ ## License
62
+
63
+ MIT
package/package.json CHANGED
@@ -1,5 +1,35 @@
1
1
  {
2
2
  "name": "@abapify/logger",
3
- "version": "0.0.0",
4
- "description": "Placeholder — real package is published via CI/CD (trusted publishing)."
5
- }
3
+ "publishConfig": {
4
+ "access": "public"
5
+ },
6
+ "version": "0.3.4",
7
+ "description": "Shared logger interface for abapify packages",
8
+ "type": "module",
9
+ "types": "./dist/index.d.mts",
10
+ "exports": {
11
+ ".": "./dist/index.mjs",
12
+ "./package.json": "./package.json"
13
+ },
14
+ "files": [
15
+ "dist",
16
+ "README.md"
17
+ ],
18
+ "keywords": [
19
+ "logger",
20
+ "abap",
21
+ "sap",
22
+ "adt"
23
+ ],
24
+ "author": "abapify",
25
+ "license": "MIT",
26
+ "repository": {
27
+ "type": "git",
28
+ "url": "git+https://github.com/abapify/adt-cli.git",
29
+ "directory": "packages/logger"
30
+ },
31
+ "homepage": "https://github.com/abapify/adt-cli/tree/main/packages/logger#readme",
32
+ "bugs": {
33
+ "url": "https://github.com/abapify/adt-cli/issues"
34
+ }
35
+ }