@rdrudra99/hardlog 0.1.2 → 0.1.3
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 +13 -13
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2 -2
- package/dist/logger.js +3 -3
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
#
|
|
1
|
+
# hardlog
|
|
2
2
|
|
|
3
|
-
[](https://www.npmjs.com/package/hardlog)
|
|
4
|
+
[](https://www.npmjs.com/package/hardlog)
|
|
5
|
+
[](https://github.com/Rdrudra99/hardlog/blob/main/LICENSE)
|
|
6
6
|
[](https://www.typescriptlang.org/)
|
|
7
7
|
|
|
8
8
|
Beautiful, colorful dev-only logging for Node.js and Browser with **zero configuration**.
|
|
@@ -16,25 +16,25 @@ Automatically detects your runtime environment and applies appropriate styling:
|
|
|
16
16
|
## Installation
|
|
17
17
|
|
|
18
18
|
```bash
|
|
19
|
-
bun add
|
|
19
|
+
bun add hardlog
|
|
20
20
|
```
|
|
21
21
|
|
|
22
22
|
```bash
|
|
23
|
-
npm install
|
|
23
|
+
npm install hardlog
|
|
24
24
|
```
|
|
25
25
|
|
|
26
26
|
```bash
|
|
27
|
-
yarn add
|
|
27
|
+
yarn add hardlog
|
|
28
28
|
```
|
|
29
29
|
|
|
30
30
|
```bash
|
|
31
|
-
pnpm add
|
|
31
|
+
pnpm add hardlog
|
|
32
32
|
```
|
|
33
33
|
|
|
34
34
|
## Basic Usage
|
|
35
35
|
|
|
36
36
|
```typescript
|
|
37
|
-
import log from '
|
|
37
|
+
import log from 'hardlog';
|
|
38
38
|
|
|
39
39
|
log.success('Server started successfully!');
|
|
40
40
|
log.error('Database connection failed');
|
|
@@ -44,10 +44,10 @@ log.info('Listening on port 3000');
|
|
|
44
44
|
|
|
45
45
|
### Output in Node.js Terminal
|
|
46
46
|
```
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
47
|
+
✅ SUCCESS Server started successfully!
|
|
48
|
+
❌ ERROR Database connection failed
|
|
49
|
+
⚠️ WARNING Missing environment variable
|
|
50
|
+
💡 INFO Listening on port 3000
|
|
51
51
|
```
|
|
52
52
|
|
|
53
53
|
### Output in Browser DevTools
|
package/dist/index.d.ts
CHANGED
|
@@ -7,7 +7,7 @@ import type { LoggerConfig } from './types.js';
|
|
|
7
7
|
*
|
|
8
8
|
* @example
|
|
9
9
|
* ```ts
|
|
10
|
-
* import log from '
|
|
10
|
+
* import log from 'hardlog';
|
|
11
11
|
*
|
|
12
12
|
* log.success('Server started successfully!');
|
|
13
13
|
* log.error('Database connection failed');
|
|
@@ -18,7 +18,7 @@ import type { LoggerConfig } from './types.js';
|
|
|
18
18
|
* @example
|
|
19
19
|
* ```ts
|
|
20
20
|
* // Configure logger
|
|
21
|
-
* import log from '
|
|
21
|
+
* import log from 'hardlog';
|
|
22
22
|
*
|
|
23
23
|
* log.config({ enabled: true, showTimestamp: true });
|
|
24
24
|
* ```
|
package/dist/index.js
CHANGED
|
@@ -7,7 +7,7 @@ import { logger } from './logger.js';
|
|
|
7
7
|
*
|
|
8
8
|
* @example
|
|
9
9
|
* ```ts
|
|
10
|
-
* import log from '
|
|
10
|
+
* import log from 'hardlog';
|
|
11
11
|
*
|
|
12
12
|
* log.success('Server started successfully!');
|
|
13
13
|
* log.error('Database connection failed');
|
|
@@ -18,7 +18,7 @@ import { logger } from './logger.js';
|
|
|
18
18
|
* @example
|
|
19
19
|
* ```ts
|
|
20
20
|
* // Configure logger
|
|
21
|
-
* import log from '
|
|
21
|
+
* import log from 'hardlog';
|
|
22
22
|
*
|
|
23
23
|
* log.config({ enabled: true, showTimestamp: true });
|
|
24
24
|
* ```
|
package/dist/logger.js
CHANGED
|
@@ -23,10 +23,10 @@ const BROWSER_STYLES = {
|
|
|
23
23
|
* Log level symbols and labels
|
|
24
24
|
*/
|
|
25
25
|
const LOG_CONFIG = {
|
|
26
|
-
success: { symbol: '
|
|
27
|
-
error: { symbol: '
|
|
26
|
+
success: { symbol: '✅', label: 'SUCCESS', color: ANSI_COLORS.green },
|
|
27
|
+
error: { symbol: '❌', label: 'ERROR', color: ANSI_COLORS.red },
|
|
28
28
|
warn: { symbol: '⚠', label: 'WARNING', color: ANSI_COLORS.yellow },
|
|
29
|
-
info: { symbol: '
|
|
29
|
+
info: { symbol: '💡', label: 'INFO', color: ANSI_COLORS.blue },
|
|
30
30
|
};
|
|
31
31
|
/**
|
|
32
32
|
* Logger class - handles all logging operations
|
package/package.json
CHANGED