Skip to content

Commit

Permalink
revert debugging changes... it was a setting on the github repo
Browse files Browse the repository at this point in the history
  • Loading branch information
jifalops committed Nov 18, 2024
1 parent de3f772 commit 6fd1953
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 29 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,11 @@ jobs:
run: |
npm ci
npm run build
npm run obfuscate
- name: Deploy 🚀
uses: JamesIves/github-pages-deploy-action@v4
with:
folder: build
# clean-exclude: pr-preview/
# force: false
clean-exclude: pr-preview/
force: false
1 change: 1 addition & 0 deletions .github/workflows/preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ jobs:
run: |
npm ci
npm run build
npm run obfuscate
- name: Deploy preview
uses: rossjrw/pr-preview-action@v1
Expand Down
1 change: 0 additions & 1 deletion src/lib/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import { TelemetryServiceMock } from './telemetry/service_mock';
const init_start = performance.now();

export const log = new Log(IS_PRODUCTION_BUILD ? Log.INFO : Log.TRACE);
log.setLevel(IS_PRODUCTION_BUILD ? Log.INFO : Log.TRACE);

log.debug(init_start, 'Initializing...');
log.debug('Config:', {
Expand Down
39 changes: 13 additions & 26 deletions src/lib/log.ts
Original file line number Diff line number Diff line change
@@ -1,19 +1,10 @@
const LEVEL = {
ASSERT: 1,
ERROR: 2,
WARN: 3,
INFO: 4,
DEBUG: 5,
TRACE: 6
} as const;

export class Log {
static readonly ASSERT = LEVEL.ASSERT;
static readonly ERROR = LEVEL.ERROR;
static readonly WARN = LEVEL.WARN;
static readonly INFO = LEVEL.INFO;
static readonly DEBUG = LEVEL.DEBUG;
static readonly TRACE = LEVEL.TRACE;
static readonly ASSERT = 1;
static readonly ERROR = 2;
static readonly WARN = 3;
static readonly INFO = 4;
static readonly DEBUG = 5;
static readonly TRACE = 6;

assert = console.assert.bind(console);
error = console.error.bind(console);
Expand All @@ -22,7 +13,7 @@ export class Log {
debug = console.debug.bind(console);
trace = console.log.bind(console);

level: number = Log.INFO;
level = Log.INFO;

constructor(level?: number) {
if (level !== undefined) {
Expand All @@ -32,22 +23,18 @@ export class Log {
}

setLevel(level: number) {
console.log('Current log level:', this.level);
console.log('New log level:', level);
console.log('Log.INFO:', Log.INFO);
console.log('Log.DEBUG:', Log.DEBUG);
this.level = level;
if (level >= Log.ASSERT) this.assert = console.assert.bind(console);
else this.assert = () => {};
else this.assert = function () {};
if (level >= Log.ERROR) this.error = console.error.bind(console);
else this.error = () => {};
else this.error = function () {};
if (level >= Log.WARN) this.warn = console.warn.bind(console);
else this.warn = () => {};
else this.warn = function () {};
if (level >= Log.INFO) this.info = console.info.bind(console);
else this.info = () => {};
else this.info = function () {};
if (level >= Log.DEBUG) this.debug = console.debug.bind(console);
else this.debug = () => {};
else this.debug = function () {};
if (level >= Log.TRACE) this.trace = console.log.bind(console);
else this.trace = () => {};
else this.trace = function () {};
}
}
Empty file added static/.nojekyll
Empty file.

0 comments on commit 6fd1953

Please sign in to comment.