Commit | Line | Data |
---|---|---|
6a1aa64f DV |
1 | .. title:: MochiKit.LoggingPane - Interactive MochiKit.Logging pane |
2 | ||
3 | Name | |
4 | ==== | |
5 | ||
6 | MochiKit.LoggingPane - Interactive MochiKit.Logging pane | |
7 | ||
8 | ||
9 | Synopsis | |
10 | ======== | |
11 | ||
12 | :: | |
13 | ||
14 | // open a pop-up window | |
15 | createLoggingPane() | |
16 | // use a div at the bottom of the document | |
17 | createLoggingPane(true); | |
18 | ||
19 | ||
20 | Description | |
21 | =========== | |
22 | ||
23 | MochiKit.Logging does not have any browser dependencies and is | |
24 | completely unobtrusive. MochiKit.LoggingPane is a browser-based | |
25 | colored viewing pane for your :mochiref:`MochiKit.Logging` output that | |
26 | can be used as a pop-up or inline. | |
27 | ||
28 | It also allows for regex and level filtering! MochiKit.LoggingPane is | |
29 | used as the default | |
30 | :mochiref:`MochiKit.Logging.debuggingBookmarklet()` if it is loaded. | |
31 | ||
32 | ||
33 | Dependencies | |
34 | ============ | |
35 | ||
36 | - :mochiref:`MochiKit.Base` | |
37 | - :mochiref:`MochiKit.Logging` | |
38 | ||
39 | ||
40 | API Reference | |
41 | ============= | |
42 | ||
43 | Constructors | |
44 | ------------ | |
45 | ||
46 | :mochidef:`LoggingPane(inline=false, logger=MochiKit.Logging.logger)`: | |
47 | ||
48 | A listener for a :mochiref:`MochiKit.Logging` logger with an | |
49 | interactive DOM representation. | |
50 | ||
51 | If ``inline`` is ``true``, then the ``LoggingPane`` will be a | |
52 | ``DIV`` at the bottom of the document. Otherwise, it will be in a | |
53 | pop-up window with a name based on the calling page's URL. If | |
54 | there is an element in the document with an id of | |
55 | ``_MochiKit_LoggingPane``, it will be used instead of appending a | |
56 | new ``DIV`` to the body. | |
57 | ||
58 | ``logger`` is the reference to the | |
59 | :mochiref:`MochiKit.Logging.Logger` to listen to. If not | |
60 | specified, the global default logger is used. | |
61 | ||
62 | Properties: | |
63 | ||
64 | ``win``: | |
65 | Reference to the pop-up window (``undefined`` if | |
66 | ``inline``) | |
67 | ||
68 | ``inline``: | |
69 | ``true`` if the ``LoggingPane`` is inline | |
70 | ||
71 | ``colorTable``: | |
72 | An object with property->value mappings for each log level | |
73 | and its color. May also be mutated on | |
74 | ``LoggingPane.prototype`` to affect all instances. For | |
75 | example:: | |
76 | ||
77 | MochiKit.LoggingPane.LoggingPane.prototype.colorTable = { | |
78 | DEBUG: "green", | |
79 | INFO: "black", | |
80 | WARNING: "blue", | |
81 | ERROR: "red", | |
82 | FATAL: "darkred" | |
83 | }; | |
84 | ||
85 | *Availability*: | |
86 | Available in MochiKit 1.3.1+ | |
87 | ||
88 | ||
89 | :mochidef:`LoggingPane.prototype.closePane()`: | |
90 | ||
91 | Close the :mochiref:`LoggingPane` (close the child window, or | |
92 | remove the ``_MochiKit_LoggingPane`` ``DIV`` from the document). | |
93 | ||
94 | *Availability*: | |
95 | Available in MochiKit 1.3.1+ | |
96 | ||
97 | ||
98 | Functions | |
99 | --------- | |
100 | ||
101 | ||
102 | :mochidef:`createLoggingPane(inline=false)`: | |
103 | ||
104 | Create or return an existing :mochiref:`LoggingPane` for this | |
105 | document with the given inline setting. This is preferred over | |
106 | using :mochiref:`LoggingPane` directly, as only one | |
107 | :mochiref:`LoggingPane` should be present in a given document. | |
108 | ||
109 | *Availability*: | |
110 | Available in MochiKit 1.3.1+ | |
111 | ||
112 | ||
113 | Authors | |
114 | ======= | |
115 | ||
116 | - Bob Ippolito <bob@redivi.com> | |
117 | ||
118 | ||
119 | Copyright | |
120 | ========= | |
121 | ||
122 | Copyright 2005 Bob Ippolito <bob@redivi.com>. This program is | |
123 | dual-licensed free software; you can redistribute it and/or modify it | |
124 | under the terms of the `MIT License`_ or the `Academic Free License | |
125 | v2.1`_. | |
126 | ||
127 | .. _`MIT License`: http://www.opensource.org/licenses/mit-license.php | |
128 | .. _`Academic Free License v2.1`: http://www.opensource.org/licenses/afl-2.1.php |