@quatrain/log 1.1.1 → 1.1.2
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/LICENSE.md
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# LICENSE UPDATE NOTICE
|
|
2
|
+
|
|
3
|
+
As of 01/01/2026, Quatrain Core is licensed under the **GNU Affero General Public License v3.0 (AGPL v3)**.
|
|
4
|
+
Previous versions remain under the MIT License.
|
|
5
|
+
|
|
6
|
+
## Why AGPL?
|
|
7
|
+
|
|
8
|
+
We believe in open collaboration for the development ecosystem. The AGPL ensures that any modification or deployment of this BaaS stack, including over a network, benefits the entire community.
|
|
9
|
+
|
|
10
|
+
## Commercial Services & Enterprise Usage
|
|
11
|
+
|
|
12
|
+
We provide official deployment services, technical training, and certification for Quatrain Core.
|
|
13
|
+
For organizations requiring a non-copyleft license (commercial license) or custom proprietary integrations, please contact the copyright holder: **Quatrain Technologies**.
|
|
14
|
+
|
|
15
|
+
Copyright © 2024-2026 Quatrain Technologies. All Rights Reserved.
|
package/package.json
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@quatrain/log",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.2",
|
|
4
4
|
"description": "Logger for business apps",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
7
|
+
"bun": "src/index.ts",
|
|
7
8
|
"files": [
|
|
9
|
+
"LICENSE.md",
|
|
8
10
|
"dist/",
|
|
9
11
|
"src/",
|
|
10
12
|
"README.md"
|
|
@@ -29,11 +31,6 @@
|
|
|
29
31
|
"test-ci": "jest --runInBand",
|
|
30
32
|
"build": "tsc",
|
|
31
33
|
"wbuild": "tsc --watch",
|
|
32
|
-
"bump-to": "yarn version"
|
|
33
|
-
"hash": "node ../../bin/hashFolder.js",
|
|
34
|
-
"hash:persist": "yarn hash > .hash_latest.txt",
|
|
35
|
-
"hash:compare": "yarn hash > .hash_newest.txt && cmp -s .hash_latest.txt .hash_newest.txt",
|
|
36
|
-
"release": "yarn hash:compare || yarn release:process",
|
|
37
|
-
"release:process": "yarn version patch && yarn build && npm publish --access public && yarn hash:persist"
|
|
34
|
+
"bump-to": "yarn version"
|
|
38
35
|
}
|
|
39
36
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const DefaultLoggerAdapter_1 = require("./DefaultLoggerAdapter");
|
|
7
|
-
const Log_1 = require("./Log");
|
|
8
|
-
const loglevel_1 = __importDefault(require("loglevel"));
|
|
9
|
-
const chalk_1 = __importDefault(require("chalk"));
|
|
10
|
-
jest.mock('loglevel', () => ({
|
|
11
|
-
setLevel: jest.fn(),
|
|
12
|
-
trace: jest.fn(),
|
|
13
|
-
debug: jest.fn(),
|
|
14
|
-
info: jest.fn(),
|
|
15
|
-
warn: jest.fn(),
|
|
16
|
-
error: jest.fn(),
|
|
17
|
-
log: jest.fn(),
|
|
18
|
-
}));
|
|
19
|
-
jest.mock('chalk', () => ({
|
|
20
|
-
grey: jest.fn((s) => s),
|
|
21
|
-
yellow: jest.fn((s) => s),
|
|
22
|
-
green: jest.fn((s) => s),
|
|
23
|
-
red: jest.fn((s) => s),
|
|
24
|
-
bgRedBright: jest.fn((s) => s),
|
|
25
|
-
}));
|
|
26
|
-
describe('DefaultLoggerAdapter', () => {
|
|
27
|
-
let adapter;
|
|
28
|
-
beforeEach(() => {
|
|
29
|
-
jest.clearAllMocks();
|
|
30
|
-
// Mock timestamp for deterministic tests
|
|
31
|
-
jest.spyOn(Log_1.Log, 'timestamp').mockReturnValue('2023-01-01T00:00:00.000Z');
|
|
32
|
-
adapter = new DefaultLoggerAdapter_1.DefaultLoggerAdapter('TEST', Log_1.LogLevel.DEBUG);
|
|
33
|
-
});
|
|
34
|
-
it('should initialize and set the log level', () => {
|
|
35
|
-
expect(loglevel_1.default.setLevel).toHaveBeenCalledWith(Log_1.LogLevel.DEBUG);
|
|
36
|
-
});
|
|
37
|
-
it('should log debug messages with yellow color', () => {
|
|
38
|
-
adapter.debug('debug message');
|
|
39
|
-
expect(loglevel_1.default.debug).toHaveBeenCalledWith('2023-01-01T00:00:00.000Z - [TEST] debug message');
|
|
40
|
-
expect(chalk_1.default.yellow).toHaveBeenCalled();
|
|
41
|
-
});
|
|
42
|
-
it('should log info messages with green color', () => {
|
|
43
|
-
adapter.info('info message');
|
|
44
|
-
expect(loglevel_1.default.info).toHaveBeenCalledWith('2023-01-01T00:00:00.000Z - [TEST] info message');
|
|
45
|
-
expect(chalk_1.default.green).toHaveBeenCalled();
|
|
46
|
-
});
|
|
47
|
-
it('should log multiple arguments correctly', () => {
|
|
48
|
-
adapter.info('msg1', 'msg2', { key: 'val' });
|
|
49
|
-
expect(loglevel_1.default.info).toHaveBeenCalledWith(expect.stringContaining('msg1 msg2 {"key":"val"}'));
|
|
50
|
-
});
|
|
51
|
-
it('should log warn messages with red color', () => {
|
|
52
|
-
adapter.warn('warn message');
|
|
53
|
-
expect(loglevel_1.default.warn).toHaveBeenCalledWith('2023-01-01T00:00:00.000Z - [TEST] warn message');
|
|
54
|
-
expect(chalk_1.default.red).toHaveBeenCalled();
|
|
55
|
-
});
|
|
56
|
-
it('should log error messages with bgRedBright color', () => {
|
|
57
|
-
adapter.error('error message');
|
|
58
|
-
expect(loglevel_1.default.error).toHaveBeenCalledWith('2023-01-01T00:00:00.000Z - [TEST] error message');
|
|
59
|
-
expect(chalk_1.default.bgRedBright).toHaveBeenCalled();
|
|
60
|
-
});
|
|
61
|
-
it('should log trace messages with grey color', () => {
|
|
62
|
-
adapter.trace('trace message');
|
|
63
|
-
expect(loglevel_1.default.trace).toHaveBeenCalledWith('2023-01-01T00:00:00.000Z - [TEST] trace message');
|
|
64
|
-
expect(chalk_1.default.grey).toHaveBeenCalled();
|
|
65
|
-
});
|
|
66
|
-
});
|