Skip to content

Commit

Permalink
log status getter
Browse files Browse the repository at this point in the history
  • Loading branch information
litstat committed Aug 14, 2024
1 parent 8e6e0b1 commit bee0131
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/capture.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import isNumber from 'underscore/modules/isNumber.js';
import noop from 'underscore/modules/noop.js';

import { applyOwn } from './apply';
import { isObject } from './is.js';
import { isObject } from './is';
import { warn } from './log';

const o = {
Expand Down
7 changes: 7 additions & 0 deletions src/log.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ export function log() {
if (enabled) {
_info.apply(c, parse(this, arguments));
}

return enabled;
}

export function debug() {
Expand All @@ -42,6 +44,8 @@ export function debug() {
if (enabled > 1) {
(enabled > 2 ? _trace : _debug).apply(c, parse(this, arguments));
}

return enabled;
}

function parse(scope, args) {
Expand Down Expand Up @@ -76,6 +80,9 @@ applyOwn(log, {
enable: (level = 1) =>
enabled = level,

enabled: () =>
enabled,

disable: () =>
enabled = 0,
});

0 comments on commit bee0131

Please sign in to comment.