Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error stack: TypeError: this.isLevelEnabled is not a function #110

Closed
hejx1 opened this issue Dec 16, 2019 · 12 comments
Closed

error stack: TypeError: this.isLevelEnabled is not a function #110

hejx1 opened this issue Dec 16, 2019 · 12 comments

Comments

@hejx1
Copy link

hejx1 commented Dec 16, 2019

import { Logger, getLogger } from 'pinus';
getLogger("game").isDebugEnabled();

isDebugEnabled 抛出异常 error stack: TypeError: this.isLevelEnabled is not a function

@whtiehack
Copy link
Member

没发现有这个方法啊。搜索源码是空的。。

@hejx1
Copy link
Author

hejx1 commented Dec 16, 2019

/node_modules/log4js/lib/logger.js>addLevelMethods

也就是 logger.js 80行 这里出现的异常

@whtiehack
Copy link
Member

没明白。可否描述详细一点。。

@hejx1
Copy link
Author

hejx1 commented Dec 16, 2019

你调用这些方法应该都会出现异常信息
isDebugEnabled(): boolean;
isInfoEnabled(): boolean;
isWarnEnabled(): boolean;
isErrorEnabled(): boolean;

@whtiehack
Copy link
Member

pinus的logger 是封装了一层的。你确定有这些方法?

@hejx1
Copy link
Author

hejx1 commented Dec 17, 2019

我是从pinus的logger点出来的

@whtiehack
Copy link
Member

修复了一下。应该没问题了。

@whtiehack whtiehack reopened this Dec 17, 2019
@hejx1
Copy link
Author

hejx1 commented Dec 17, 2019

好的

@whtiehack
Copy link
Member

1.4.0马上就发布好了。可以一起测试一下。

@whtiehack
Copy link
Member

现在 getLogger 返回的对象是原始的 log4js对象。

@hejx1
Copy link
Author

hejx1 commented Dec 17, 2019

好的 我去试试

@whtiehack
Copy link
Member

还有问题吗?没问题关一下issue哈。

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

No branches or pull requests

2 participants