From 4fe1c21eaa085748752065559b9d53d19ffd1a88 Mon Sep 17 00:00:00 2001 From: Meir Rotstein Date: Sun, 19 Nov 2017 11:42:07 +0200 Subject: [PATCH] update readme with logger option --- README.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/README.md b/README.md index a40f89a..d756f27 100644 --- a/README.md +++ b/README.md @@ -1060,6 +1060,7 @@ Defaults: formats: {}, unknownFormats: true, schemas: {}, + logger: undefined, // referenced schema options: schemaId: undefined // recommended '$id' missingRefs: true, @@ -1105,6 +1106,16 @@ Defaults: - `[String]` - an array of unknown format names that will be ignored. This option can be used to allow usage of third party schemas with format(s) for which you don't have definitions, but still fail if another unknown format is used. If `format` keyword value is [$data reference](#data-reference) and it is not in this array the validation will fail. - `"ignore"` - to log warning during schema compilation and always pass validation (the default behaviour in versions before 5.0.0). This option is not recommended, as it allows to mistype format name and it won't be validated without any error message. This behaviour is required by JSON-schema specification. - _schemas_: an array or object of schemas that will be added to the instance. In case you pass the array the schemas must have IDs in them. When the object is passed the method `addSchema(value, key)` will be called for each schema in this object. +- _logger_: sets the logging method. deafult is the global `console` object. Option values: + - custom logger object, should implement the following methods: + ``` + { + log: function() {...}, + warn: function() {...}, + error: function() {...} + } + ``` + - `false` - logging is disabled ##### Referenced schema options