mirror of
https://github.com/thelounge/thelounge
synced 2024-11-22 12:03:11 +00:00
Inline logger into changelog script
We can't really import easily from our build without it being brittle. TL isn't meant to be used as a library. Instead, just inline the logger as it is trivial enough.
This commit is contained in:
parent
21ada132b1
commit
0f3487c533
1 changed files with 26 additions and 1 deletions
|
@ -53,13 +53,38 @@ const got = require("got");
|
|||
const dayjs = require("dayjs");
|
||||
const semver = require("semver");
|
||||
const util = require("util");
|
||||
const log = require("../server/log");
|
||||
const packageJson = require("../package.json");
|
||||
let token = process.env.CHANGELOG_TOKEN;
|
||||
|
||||
const readFile = util.promisify(fs.readFile);
|
||||
const writeFile = util.promisify(fs.writeFile);
|
||||
|
||||
function timestamp() {
|
||||
const datetime = new Date().toISOString().split(".")[0].replace("T", " ");
|
||||
|
||||
return colors.dim(datetime);
|
||||
}
|
||||
|
||||
const log = {
|
||||
/* eslint-disable no-console */
|
||||
error(...args) {
|
||||
console.error(timestamp(), colors.red("[ERROR]"), ...args);
|
||||
},
|
||||
warn(...args) {
|
||||
console.error(timestamp(), colors.yellow("[WARN]"), ...args);
|
||||
},
|
||||
info(...args) {
|
||||
console.log(timestamp(), colors.blue("[INFO]"), ...args);
|
||||
},
|
||||
debug(...args) {
|
||||
console.log(timestamp(), colors.green("[DEBUG]"), ...args);
|
||||
},
|
||||
raw(...args) {
|
||||
console.log(...args);
|
||||
},
|
||||
/* eslint-enable no-console */
|
||||
};
|
||||
|
||||
const changelogPath = path.resolve(__dirname, "..", "CHANGELOG.md");
|
||||
|
||||
// CLI argument validations
|
||||
|
|
Loading…
Reference in a new issue