Add some JSDoc types to @overleaf/logger (#19153)

* Add some JSDoc types to `@overleaf/logger`

* Update `logger.error` calls

* Fixup `logger.err` JSDoc

* Update `logger.err` calls

* Fix `args` type

* Remove "Error message" description

* Replace `arguments` by actual arguments of the method

* Fix: "ESLint: Unnecessary '.apply()'.(no-useless-call)"

* Add JSDoc params to `debug` `info` `warn`

* Remove extra `args` param in JSDoc so developers aren't invited to use it

Not sure if this is the best thing to do because it creates a warning in the IDE: "Parameter args is not described in JSDoc"

* Add comment about serialization of `err` `req` `res`

* Allow strings as first param in `debug` `info` `warn`

* Fix syntax for optional parameters in JSDoc

* Add 2 signatures, to avoid "string, string" params

* Fix `@signature` names copy-pastes

Co-authored-by: Jakob Ackermann <jakob.ackermann@overleaf.com>

* Revert the double `@param attributes`. It doesn't work

---------

Co-authored-by: Jakob Ackermann <jakob.ackermann@overleaf.com>
GitOrigin-RevId: 086dee8bbf30d577c5e1f844a9df5e518c46aca7
This commit is contained in:
Antoine Clausse
2024-06-28 08:04:25 +00:00
committed by Copybot
co-authored by Jakob Ackermann
parent 1dbbe5af9d
commit 01188589f8
4 changed files with 48 additions and 11 deletions
+1 -1
View File
@@ -165,7 +165,7 @@ if (!module.parent) {
// Called directly
app.listen(port, host, error => {
if (error) {
logger.error('Error starting Filestore', error)
logger.error({ err: error }, 'Error starting Filestore')
throw error
}
logger.debug(`Filestore starting up, listening on ${host}:${port}`)