@etherdata-blockchain/logger
Advanced tools
Comparing version 1.4.15 to 1.5.0
@@ -6,2 +6,13 @@ # Change Log | ||
# 1.5.0 (2022-01-16) | ||
### Features | ||
* **tests:** add more tests in logger package and fix service bugs ([#4](https://github.com/etherdata-blockchain/packages/issues/4)) ([c179fdc](https://github.com/etherdata-blockchain/packages/commit/c179fdc055d21edcdb83518ed1b2537c4670468d)) | ||
## 1.4.15 (2022-01-16) | ||
@@ -8,0 +19,0 @@ |
{ | ||
"name": "@etherdata-blockchain/logger", | ||
"version": "1.4.15", | ||
"main": "src/index.js", | ||
"version": "1.5.0", | ||
"main": "src/index.ts", | ||
"license": "MIT", | ||
@@ -22,3 +22,3 @@ "dependencies": { | ||
}, | ||
"gitHead": "2c95518ee3d7d3e34a3c88aafdd2c9fa08f5dbc8" | ||
"gitHead": "08d692b32731b4409e500be4589a89082cfbbe06" | ||
} |
import moment from "moment"; | ||
import chalk from "chalk"; | ||
export class Logger { | ||
static info(message: any) { | ||
console.log( | ||
`[${chalk.blue("INFO")}] ${chalk.gray( | ||
moment().format("hh:mm:ss") | ||
)} ${message}` | ||
); | ||
console.log(`[INFO] ${moment().format("hh:mm:ss")} ${message}`); | ||
} | ||
static warning(message: any) { | ||
console.log( | ||
`[${chalk.yellow("WARNING")}] ${chalk.gray( | ||
moment().format("hh:mm:ss") | ||
)} ${message}` | ||
); | ||
console.log(`[WARNING] ${moment().format("hh:mm:ss")} ${message}`); | ||
} | ||
static error(message: any) { | ||
console.log( | ||
`[${chalk.red("Error")}] ${chalk.gray( | ||
moment().format("hh:mm:ss") | ||
)} ${message}` | ||
); | ||
console.log(`[Error] ${moment().format("hh:mm:ss")} ${message}`); | ||
} | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
12987
7
131