waffle/frontend/src/logging.js

14 lines
309 B
JavaScript
Raw Normal View History

2022-05-05 20:52:35 +03:00
import { getItem } from "./storage";
export default function logger(sink) {
return (...args) => {
if (getItem(`log:${sink}`)) {
2022-05-05 20:52:35 +03:00
console.log(
`%c[${sink}]`,
"color: #8f3f71; font-weight: bold;",
...args
);
}
};
}