Skip to content

Commit

Permalink
make logger export separate functions instead of object
Browse files Browse the repository at this point in the history
  • Loading branch information
GooseOb committed Dec 11, 2024
1 parent 4809aa2 commit ef4fbe6
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 12 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "yt-defaulter",
"author": "GooseOb",
"version": "1.11.6",
"version": "1.11.7",
"repository": {
"type": "git",
"url": "git+https://github.com/GooseOb/YT-Defaulter.git"
Expand Down
21 changes: 11 additions & 10 deletions src/logger.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
export const logger = {
// log(...msgs: string[]) {
// console.log('[YT-Defaulter]', ...msgs);
// },
err(...msgs: readonly string[]) {
console.error('[YT-Defaulter]', ...msgs);
},
outOfRange(what: string) {
this.err(what, 'value is out of range');
},
export const log = (...msgs: string[]) => {
console.log('[YT-Defaulter]', ...msgs);
};
export const err = (...msgs: readonly string[]) => {
console.error('[YT-Defaulter]', ...msgs);
};
export const outOfRange = (what: string) => {
err(what, 'value is out of range');
};
export const trace = (msg: any, label?: string) => (
console.log(msg, label), msg
);
2 changes: 1 addition & 1 deletion src/player/value-setters.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as config from '../config';
import { logger } from '../logger';
import * as logger from '../logger';
import { plr } from '../player';

type YtSettingName = typeof SPEED | typeof QUALITY;
Expand Down

0 comments on commit ef4fbe6

Please sign in to comment.