1
0
mirror of https://github.com/mpv-player/mpv synced 2025-02-16 12:17:12 +00:00

js: implement mp.msg.trace()

To match the new Lua helper introduced in
1afdeee1ad

Add documentation for both.
This commit is contained in:
TheAMM 2017-12-16 10:18:20 +02:00 committed by Kevin Mitchell
parent 1afdeee1ad
commit 3c4667c862
3 changed files with 8 additions and 5 deletions

View File

@ -164,6 +164,8 @@ Otherwise, where the Lua APIs return ``nil`` on error, JS returns ``undefined``.
``mp.msg.debug(...)`` ``mp.msg.debug(...)``
``mp.msg.trace(...)``
``mp.utils.getcwd()`` (LE) ``mp.utils.getcwd()`` (LE)
``mp.utils.readdir(path [, filter])`` (LE) ``mp.utils.readdir(path [, filter])`` (LE)

View File

@ -487,16 +487,17 @@ with ``require 'mp.msg'``.
``msg.log(level, ...)`` ``msg.log(level, ...)``
The level parameter is the message priority. It's a string and one of The level parameter is the message priority. It's a string and one of
``fatal``, ``error``, ``warn``, ``info``, ``v``, ``debug``. The user's ``fatal``, ``error``, ``warn``, ``info``, ``v``, ``debug``, ``trace``. The
settings will determine which of these messages will be visible. Normally, user's settings will determine which of these messages will be
all messages are visible, except ``v`` and ``debug``. visible. Normally, all messages are visible, except ``v``, ``debug`` and
``trace``.
The parameters after that are all converted to strings. Spaces are inserted The parameters after that are all converted to strings. Spaces are inserted
to separate multiple parameters. to separate multiple parameters.
You don't need to add newlines. 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 All of these are shortcuts and equivalent to the corresponding
``msg.log(level, ...)`` call. ``msg.log(level, ...)`` call.

View File

@ -7,7 +7,7 @@
mp.msg = { log: mp.log }; mp.msg = { log: mp.log };
mp.msg.verbose = mp.log.bind(null, "v"); 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) }); 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. // same as {} but without inherited stuff, e.g. o["toString"] doesn't exist.