Skip to content

Added logLevel method#4

Open
Anonym-tsk wants to merge 2 commits intotheshock:masterfrom
Anonym-tsk:patch-1
Open

Added logLevel method#4
Anonym-tsk wants to merge 2 commits intotheshock:masterfrom
Anonym-tsk:patch-1

Conversation

@Anonym-tsk
Copy link

Usage:
console.logLevel('debug');
Available levels:
all - all messages will be shown
debug - same as "all" excluding console.log and console.info
log - same as "all" excluding console.debug and console.count
info - same as "log" excluding console.log
warn - same as "info" excluding console.info
error - same as "warn" excluding console.warn

Usage:
console.logLevel('debug');
Available levels:
all - all messages will be shown
debug - same as "all" excluding console.log and console.info
log - same as "all" excluding console.debug and console.count
info - same as "log" excluding console.log
warn - same as "info" excluding console.info
error - same as "warn" excluding console.warn
@theshock
Copy link
Owner

Привет! Извини, что-то пропустил этот пул-реквест(
Хотел бы обсудить его.
Название метода мне кажется немного некорректным. Словно это настройка для метода console.log, а не для всего console в целом.
Плюс передавать строковыми настройками - не очень корректно. Может, стоит сделать хеш методов? Как-то так:

console.level.warn()

@ghost ghost assigned theshock Apr 15, 2013
@Anonym-tsk
Copy link
Author

В принципе, разницы то нет. Просто logLevel - это, мне кажется, общепринятое обозначение, хотя я согласен, что строковый параметр это очень неудобно. В этом плане console.level.warn() будет удобнее, но тогда уж, если не logLevel, то, хотя бы setLevel, чтобы было понятно, что делает метод.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants