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

accessing the logger doesnt work #34

Closed
ghost opened this issue Jan 22, 2019 · 7 comments
Closed

accessing the logger doesnt work #34

ghost opened this issue Jan 22, 2019 · 7 comments
Assignees

Comments

@ghost
Copy link

ghost commented Jan 22, 2019

I want to disable the winston logger but cant seem to access it in the way it is explained in the docs.
Seems like:

var smashgg = require('smashgg.js');
smashgg.setLogLevel('warn');

doesnt work, it keeps throwing undfinded error for setLogLevel().

@BrandonCookeDev
Copy link
Owner

BrandonCookeDev commented Jan 22, 2019

can you please post your error stack?
and also post your package.json if you wouldn't mind? What version of smashgg.js are you running?

@BrandonCookeDev BrandonCookeDev self-assigned this Jan 22, 2019
@ghost
Copy link
Author

ghost commented Jan 22, 2019

TypeError: smashgg.setLogLevel is not a function
[0]     at Object.<anonymous> (D:\nodep\smash\server\core\scraper.js:22:9)
[0]     at Module._compile (internal/modules/cjs/loader.js:688:30)
[0]     at Object.Module._extensions..js (internal/modules/cjs/loader.js:699:10)
[0]     at Module.load (internal/modules/cjs/loader.js:598:32)
[0]     at tryModuleLoad (internal/modules/cjs/loader.js:537:12)
[0]     at Function.Module._load (internal/modules/cjs/loader.js:529:3)
[0]     at Module.require (internal/modules/cjs/loader.js:636:17)
[0]     at require (internal/modules/cjs/helpers.js:20:18)
[0]     at Object.<anonymous> (D:\nodep\smash\server\core\dbManage.js:1:79)
[0]     at Module._compile (internal/modules/cjs/loader.js:688:30)
[0]     at Object.Module._extensions..js (internal/modules/cjs/loader.js:699:10)
[0]     at Module.load (internal/modules/cjs/loader.js:598:32)
[0]     at tryModuleLoad (internal/modules/cjs/loader.js:537:12)
[0]     at Function.Module._load (internal/modules/cjs/loader.js:529:3)
[0]     at Module.require (internal/modules/cjs/loader.js:636:17)
[0]     at require (internal/modules/cjs/helpers.js:20:18)
[0]     at Object.<anonymous> (D:\nodep\smash\server\server.js:3:18)
[0]     at Module._compile (internal/modules/cjs/loader.js:688:30)
[0]     at Object.Module._extensions..js (internal/modules/cjs/loader.js:699:10)
[0]     at Module.load (internal/modules/cjs/loader.js:598:32)
[0]     at tryModuleLoad (internal/modules/cjs/loader.js:537:12)
[0]     at Function.Module._load (internal/modules/cjs/loader.js:529:3)
[0]     at Function.Module.runMain (internal/modules/cjs/loader.js:741:12)
[0]     at startup (internal/bootstrap/node.js:285:19)
[0]     at bootstrapNodeJSCore (internal/bootstrap/node.js:739:3)

@BrandonCookeDev
Copy link
Owner

What version of smashgg.js are you using?
This functionality was introduced in 3.2+ so if you have anything before that you'll get the undefined error.

@ghost
Copy link
Author

ghost commented Jan 23, 2019

I updated the dependencies and it works now, thanks alot. How can i disable the logger completely though?

@BrandonCookeDev
Copy link
Owner

yeah, I didn't really program that in, but I can hotpatch it tonight. For now you can just set the logLevel to 'error' and it will only pop up if an error happens in smashgg.js

@BrandonCookeDev
Copy link
Owner

I will take some time to hotpatch in disableLogger soon

@BrandonCookeDev
Copy link
Owner

@L3mmAa issue #35 adds access to disable the logger

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

1 participant