summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTheAMM <the.actual.amm@gmail.com>2017-12-16 10:18:20 +0200
committerKevin Mitchell <kevmitch@gmail.com>2017-12-16 02:25:24 -0800
commit3c4667c862dba05d89d0fd24a198bb49c8c47cb8 (patch)
tree1d272f73d4a86487b87114eb7dc1e3ad010bbfeb
parent1afdeee1ad8bca1c703e741002fa3b882d162968 (diff)
downloadmpv-3c4667c862dba05d89d0fd24a198bb49c8c47cb8.tar.bz2
mpv-3c4667c862dba05d89d0fd24a198bb49c8c47cb8.tar.xz
js: implement mp.msg.trace()
To match the new Lua helper introduced in 1afdeee1ad8bca1c703e741002fa3b882d162968 Add documentation for both.
-rw-r--r--DOCS/man/javascript.rst2
-rw-r--r--DOCS/man/lua.rst9
-rw-r--r--player/javascript/defaults.js2
3 files changed, 8 insertions, 5 deletions
diff --git a/DOCS/man/javascript.rst b/DOCS/man/javascript.rst
index 419f473e2c..2ebdb15896 100644
--- a/DOCS/man/javascript.rst
+++ b/DOCS/man/javascript.rst
@@ -164,6 +164,8 @@ Otherwise, where the Lua APIs return ``nil`` on error, JS returns ``undefined``.
``mp.msg.debug(...)``
+``mp.msg.trace(...)``
+
``mp.utils.getcwd()`` (LE)
``mp.utils.readdir(path [, filter])`` (LE)
diff --git a/DOCS/man/lua.rst b/DOCS/man/lua.rst
index 5fe7507049..2e354c282f 100644
--- a/DOCS/man/lua.rst
+++ b/DOCS/man/lua.rst
@@ -487,16 +487,17 @@ with ``require 'mp.msg'``.
``msg.log(level, ...)``
The level parameter is the message priority. It's a string and one of
- ``fatal``, ``error``, ``warn``, ``info``, ``v``, ``debug``. The user's
- settings will determine which of these messages will be visible. Normally,
- all messages are visible, except ``v`` and ``debug``.
+ ``fatal``, ``error``, ``warn``, ``info``, ``v``, ``debug``, ``trace``. The
+ user's settings will determine which of these messages will be
+ visible. Normally, all messages are visible, except ``v``, ``debug`` and
+ ``trace``.
The parameters after that are all converted to strings. Spaces are inserted
to separate multiple parameters.
You don't need to add newlines.
-``msg.fatal(...)``, ``msg.error(...)``, ``msg.warn(...)``, ``msg.info(...)``, ``msg.verbose(...)``, ``msg.debug(...)``
+``msg.fatal(...)``, ``msg.error(...)``, ``msg.warn(...)``, ``msg.info(...)``, ``msg.verbose(...)``, ``msg.debug(...)``, ``msg.trace(...)``
All of these are shortcuts and equivalent to the corresponding
``msg.log(level, ...)`` call.
diff --git a/player/javascript/defaults.js b/player/javascript/defaults.js
index f35add5904..56c83f8abb 100644
--- a/player/javascript/defaults.js
+++ b/player/javascript/defaults.js
@@ -7,7 +7,7 @@
mp.msg = { log: mp.log };
mp.msg.verbose = mp.log.bind(null, "v");
-var levels = ["fatal", "error", "warn", "info", "debug"];
+var levels = ["fatal", "error", "warn", "info", "debug", "trace"];
levels.forEach(function(l) { mp.msg[l] = mp.log.bind(null, l) });
// same as {} but without inherited stuff, e.g. o["toString"] doesn't exist.