@athenna/logger 1.0.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/LICENSE.md +21 -0
- package/README.md +34 -0
- package/index.d.ts +12 -0
- package/index.js +24 -0
- package/package.json +159 -0
- package/src/Contracts/DriverContract.d.ts +11 -0
- package/src/Contracts/DriverContract.js +10 -0
- package/src/Contracts/FormatterContract.d.ts +11 -0
- package/src/Contracts/FormatterContract.js +10 -0
- package/src/Drivers/ConsoleDriver.d.ts +24 -0
- package/src/Drivers/ConsoleDriver.js +32 -0
- package/src/Drivers/DebugDriver.d.ts +25 -0
- package/src/Drivers/DebugDriver.js +33 -0
- package/src/Drivers/FileDriver.d.ts +23 -0
- package/src/Drivers/FileDriver.js +41 -0
- package/src/Exceptions/ChannelNotConfiguredException.d.ts +12 -0
- package/src/Exceptions/ChannelNotConfiguredException.js +19 -0
- package/src/Exceptions/DriverAlreadyExistException.d.ts +12 -0
- package/src/Exceptions/DriverAlreadyExistException.js +19 -0
- package/src/Exceptions/FormatterAlreadyExistException.d.ts +12 -0
- package/src/Exceptions/FormatterAlreadyExistException.js +19 -0
- package/src/Exceptions/NotFoundDriverException.d.ts +12 -0
- package/src/Exceptions/NotFoundDriverException.js +19 -0
- package/src/Exceptions/NotFoundFormatterException.d.ts +12 -0
- package/src/Exceptions/NotFoundFormatterException.js +19 -0
- package/src/Factories/DriverFactory.d.ts +19 -0
- package/src/Factories/DriverFactory.js +59 -0
- package/src/Factories/FormatterFactory.d.ts +18 -0
- package/src/Factories/FormatterFactory.js +45 -0
- package/src/Formatters/ContextFormatter.d.ts +19 -0
- package/src/Formatters/ContextFormatter.js +32 -0
- package/src/Formatters/DebugFormatter.d.ts +20 -0
- package/src/Formatters/DebugFormatter.js +32 -0
- package/src/Formatters/JsonFormatter.d.ts +16 -0
- package/src/Formatters/JsonFormatter.js +20 -0
- package/src/Formatters/LogFormatter.d.ts +18 -0
- package/src/Formatters/LogFormatter.js +33 -0
- package/src/Log.d.ts +18 -0
- package/src/Log.js +79 -0
- package/src/Logger.d.ts +19 -0
- package/src/Logger.js +73 -0
- package/src/Utils/Color.d.ts +37 -0
- package/src/Utils/Color.js +84 -0
- package/src/Utils/getTimestamp.d.ts +9 -0
- package/src/Utils/getTimestamp.js +23 -0
- package/src/Utils/global.d.ts +15 -0
- package/src/Utils/global.js +15 -0
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* @athenna/logger
|
|
4
|
+
*
|
|
5
|
+
* (c) João Lenon <lenon@athenna.io>
|
|
6
|
+
*
|
|
7
|
+
* For the full copyright and license information, please view the LICENSE
|
|
8
|
+
* file that was distributed with this source code.
|
|
9
|
+
*/
|
|
10
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
11
|
+
exports.getTimestamp = void 0;
|
|
12
|
+
function getTimestamp() {
|
|
13
|
+
const localeStringOptions = {
|
|
14
|
+
year: 'numeric',
|
|
15
|
+
hour: 'numeric',
|
|
16
|
+
minute: 'numeric',
|
|
17
|
+
second: 'numeric',
|
|
18
|
+
day: '2-digit',
|
|
19
|
+
month: '2-digit',
|
|
20
|
+
};
|
|
21
|
+
return new Date(Date.now()).toLocaleString(undefined, localeStringOptions);
|
|
22
|
+
}
|
|
23
|
+
exports.getTimestamp = getTimestamp;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @athenna/logger
|
|
3
|
+
*
|
|
4
|
+
* (c) João Lenon <lenon@athenna.io>
|
|
5
|
+
*
|
|
6
|
+
* For the full copyright and license information, please view the LICENSE
|
|
7
|
+
* file that was distributed with this source code.
|
|
8
|
+
*/
|
|
9
|
+
import { Log as LogFunction } from '../Log';
|
|
10
|
+
import { Logger as LoggerClass } from '../Logger';
|
|
11
|
+
export {};
|
|
12
|
+
declare global {
|
|
13
|
+
const Log: typeof LogFunction;
|
|
14
|
+
const Logger: typeof LoggerClass;
|
|
15
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* @athenna/logger
|
|
4
|
+
*
|
|
5
|
+
* (c) João Lenon <lenon@athenna.io>
|
|
6
|
+
*
|
|
7
|
+
* For the full copyright and license information, please view the LICENSE
|
|
8
|
+
* file that was distributed with this source code.
|
|
9
|
+
*/
|
|
10
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
11
|
+
const Log_1 = require("../Log");
|
|
12
|
+
const Logger_1 = require("../Logger");
|
|
13
|
+
const _global = global;
|
|
14
|
+
_global.Log = Log_1.Log;
|
|
15
|
+
_global.Logger = Logger_1.Logger;
|