JKHeadley / rest-hapi

🚀 A RESTful API generator for Node.js
https://resthapi.com
MIT License
1.19k stars 153 forks source link

[Bug /Question/Request?] config.loglevel #243

Open hmenzagh opened 4 years ago

hmenzagh commented 4 years ago

To keep it simple:

I'm trying to log what routes are called but not the result, and changing between :

 * - INTERNAL use it for logging calls and other internal stuff
 * - DEBUG recommended to use it for debugging applications
 * - NOTE development verbose information (default)
 * - INFO minor information
 * - LOG significant messages

does not seem to do much. Am I missing something ? If I change the loglevel to WARNING nothing shows up (maybe errors etc) but not the routes being generated for instance.

Is that the expected behavior ?

(running the latest version of everything)

JKHeadley commented 4 years ago

@hmenzagh sorry for the delay. Yes I believe this is just a matter of better configuring of the logging code, which is in need of some pretty major refactoring in general. Most likely you are referring to the list results, which can be quite verbose:

https://github.com/JKHeadley/rest-hapi/blob/master/utilities/handler-helper.js#L221

I'll see about at least changing this to Log.info to help keep it manageable, or please feel free to do it yourself and open a PR :)

hmenzagh commented 4 years ago

Thanks ! I'll look into it if you didn't do the changes next time I manage my rest-hapi code

hmenzagh commented 4 years ago

Pull request : #251