OLD | NEW |
(Empty) | |
| 1 /* Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 * Use of this source code is governed by a BSD-style license that can be |
| 3 * found in the LICENSE file. |
| 4 */ |
| 5 #ifndef PPAPI_C_DEV_PPB_CONSOLE_DEV_H_ |
| 6 #define PPAPI_C_DEV_PPB_CONSOLE_DEV_H_ |
| 7 |
| 8 #include "ppapi/c/pp_instance.h" |
| 9 #include "ppapi/c/pp_var.h" |
| 10 |
| 11 #define PPB_CONSOLE_DEV_INTERFACE "PPB_Console(Dev);0.1" |
| 12 |
| 13 typedef enum { |
| 14 PP_LOGLEVEL_TIP = 0, |
| 15 PP_LOGLEVEL_LOG, |
| 16 PP_LOGLEVEL_WARNING, |
| 17 PP_LOGLEVEL_ERROR |
| 18 } PP_LogLevel_Dev; |
| 19 |
| 20 struct PPB_Console_Dev { |
| 21 /** |
| 22 * Logs the given message to the JavaScript console associated with the |
| 23 * given plugin instance with the given logging level. The name of the plugin |
| 24 * issuing the log message will be automatically prepended to the message. |
| 25 * The value may be any type of Var. |
| 26 */ |
| 27 void (*Log)(PP_Instance instance, PP_LogLevel_Dev level, struct PP_Var value); |
| 28 |
| 29 /** |
| 30 * Logs a message to the console with the given source information rather |
| 31 * than using the internal PPAPI plugin name. The name must be a string var. |
| 32 * |
| 33 * The regular log function will automatically prepend the name of your |
| 34 * plugin to the message as the "source" of the message. Some plugins may |
| 35 * wish to override this. For example, if your plugin is a Python |
| 36 * interpreter, you would want log messages to contain the source .py file |
| 37 * doing the log statement rather than have "python" show up in the console. |
| 38 */ |
| 39 void (*LogWithSource)(PP_Instance instance, |
| 40 PP_LogLevel_Dev level, |
| 41 struct PP_Var source, |
| 42 struct PP_Var value); |
| 43 }; |
| 44 |
| 45 #endif // PPAPI_C_DEV_PPB_CONSOLE_DEV_H_ |
OLD | NEW |