logalize 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/README.md +281 -0
- data/lib/logalize/rails/engine.rb +6 -0
- data/lib/logalize/rails/version.rb +5 -0
- data/lib/logalize/rails.rb +7 -0
- data/lib/logalize.rb +4 -0
- data/vendor/assets/javascripts/logalize.js +13 -0
- data/vendor/assets/stylesheets/logalize.css +55 -0
- metadata +53 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: d7aa3313afb986e5ed8fc08864993f69612f0d48
|
4
|
+
data.tar.gz: b509c0ab561de50cfe41126e5bff404913c83fdc
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: ce1bc1a2cf8a88b731da104e24a33c77561aea36295346558e2e8240a563460ddf8eea98a9bc289933079805ca384224a08a22c9f0c19b2ca2b28fc01c40ae3f
|
7
|
+
data.tar.gz: 3dcb7344648d8b2aec5d48499cc0a2cc5a800eee73cea6940dda4bc6114caa49758c27313e9c54d0d8e7065d3dbbcdb9c0ad0e6d8ebfc2ae7eeac22dd832dfc6
|
data/README.md
ADDED
@@ -0,0 +1,281 @@
|
|
1
|
+
# Logalize
|
2
|
+
|
3
|
+
Logalize is a Javascript wrapper for browser's developer console. Its goal is to make debugging
|
4
|
+
easier.
|
5
|
+
|
6
|
+
This is a Rails gem version of the library. For source files and an npm package, go [here](https://github.com/akxcv/logalize).
|
7
|
+
|
8
|
+
## Installation
|
9
|
+
|
10
|
+
Add this to your `Gemfile`:
|
11
|
+
```
|
12
|
+
gem 'logalize'
|
13
|
+
```
|
14
|
+
|
15
|
+
Add this to your `application.js`:
|
16
|
+
```
|
17
|
+
//= require logalize
|
18
|
+
```
|
19
|
+
|
20
|
+
Add this to your `application.css`:
|
21
|
+
```
|
22
|
+
*= require logalize
|
23
|
+
```
|
24
|
+
|
25
|
+
## Why?
|
26
|
+
|
27
|
+
The builtin developer console in modern browsers suffers from a number of problems. Here are some
|
28
|
+
of the big ones:
|
29
|
+
|
30
|
+
**There's no good way to turn logging on/off.**
|
31
|
+
|
32
|
+
Most of the time you don't want your clients to
|
33
|
+
see debugging output in their console on your production website. But, `console.log` does not
|
34
|
+
care if it runs in development or production, it's going to log anyway. This leads to developers
|
35
|
+
seldom using the console *or* writing `console.log` over and over again just to erase
|
36
|
+
it afterwards (...just to write it back again afterwards, and so on). Disabling the console
|
37
|
+
is still possible (e.x. `if (!debug) console.log = function () {}`), but it's not a good solution
|
38
|
+
if you use other console methods (which you should!). Also, imagine you want to be able to
|
39
|
+
see debugging output in production while normal website users don't see anything. What do you do?
|
40
|
+
|
41
|
+
Logalize solves this problem by introducing a flexible enable/disable mechanism. First of all, you
|
42
|
+
can enable or disable it during initialization: `logalize = new Logalize({ enabled: debug })`
|
43
|
+
(assuming that `debug` is `true` in development and `false` in production). But also, you can
|
44
|
+
enable or disable Logalize in your browser (`logalize.enable()` or `logalize.disable()`), which will
|
45
|
+
override the global `enabled` option. Thus, you can easily switch Logalize on/off in any environment,
|
46
|
+
and it will only affect *your* console.
|
47
|
+
|
48
|
+
See [initialization options](#initialization-options).
|
49
|
+
|
50
|
+
**`console.group` is a great idea, but it's not implemented well**
|
51
|
+
|
52
|
+
With [`console.group`](https://developers.google.com/web/tools/chrome-devtools/console/console-reference#group) you can split your output in foldable groups, which is a *very* good thing
|
53
|
+
to be able to do. However, a lot of JS these days is *asynchronous*, which is something you have
|
54
|
+
to constantly think about if you want to group your output.
|
55
|
+
|
56
|
+
Consider this simple scenario:
|
57
|
+
|
58
|
+
```js
|
59
|
+
async function f1() {
|
60
|
+
console.group('group 1');
|
61
|
+
console.log('function 1 start');
|
62
|
+
await sleep(1000);
|
63
|
+
console.log('function 1 end');
|
64
|
+
console.groupEnd();
|
65
|
+
}
|
66
|
+
|
67
|
+
async function f2() {
|
68
|
+
console.group('group 2');
|
69
|
+
console.log('function 2 start');
|
70
|
+
await sleep(500);
|
71
|
+
console.log('function 2 end');
|
72
|
+
console.groupEnd();
|
73
|
+
}
|
74
|
+
|
75
|
+
f1(); f2()
|
76
|
+
```
|
77
|
+
|
78
|
+
Result:
|
79
|
+
|
80
|
+

|
81
|
+
|
82
|
+
Logalize solves this by creating a different implementation of groups. With Logalize, you can use
|
83
|
+
groups like this:
|
84
|
+
|
85
|
+
```js
|
86
|
+
logalize.group('my namespace').log('hello from my namespace')
|
87
|
+
/* or */
|
88
|
+
logalize.group('my namespace', function () {
|
89
|
+
logalize.log('hello from my namespace')
|
90
|
+
/* ... */
|
91
|
+
})
|
92
|
+
```
|
93
|
+
|
94
|
+
See [grouping](#grouping)
|
95
|
+
|
96
|
+
**`console.log` supports formatting with CSS, but it's not convenient**
|
97
|
+
|
98
|
+
`console` supports formatting with CSS rules:
|
99
|
+
|
100
|
+
```js
|
101
|
+
console.log('roses are %cred%c, violets are %cblue', 'color: red;', 'color: black;', 'color: blue;')
|
102
|
+
```
|
103
|
+
|
104
|
+
Result:
|
105
|
+
|
106
|
+

|
107
|
+
|
108
|
+
This is awesome, but really not convenient.
|
109
|
+
|
110
|
+
Logalize makes formatting much easier by introducing a markdown-like syntax. See [formatting](#formatting).
|
111
|
+
|
112
|
+
## Browser support
|
113
|
+
|
114
|
+
TBD
|
115
|
+
|
116
|
+
## Usage
|
117
|
+
|
118
|
+
Methods that work exactly like their console's counterparts:
|
119
|
+
|
120
|
+
- [`assert`](https://developers.google.com/web/tools/chrome-devtools/console/console-reference#assert)
|
121
|
+
- [`count`](https://developers.google.com/web/tools/chrome-devtools/console/console-reference#count)
|
122
|
+
- [`debug`](https://developers.google.com/web/tools/chrome-devtools/console/console-reference#consoledebugobject_object)
|
123
|
+
[also supports formatting](#formatting)
|
124
|
+
- [`dir`](https://developers.google.com/web/tools/chrome-devtools/console/console-reference#dir)
|
125
|
+
- [`dirxml`](https://developers.google.com/web/tools/chrome-devtools/console/console-reference#consoledirxmlobject)
|
126
|
+
- [`error`](https://developers.google.com/web/tools/chrome-devtools/console/console-reference#error)
|
127
|
+
[also supports formatting](#formatting), see [known issues](#known-issues)
|
128
|
+
- [`info`](https://developers.google.com/web/tools/chrome-devtools/console/console-reference#consoleinfoobject_object) [also supports formatting](#formatting)
|
129
|
+
- [`log`](https://developers.google.com/web/tools/chrome-devtools/console/console-reference#log)
|
130
|
+
[also supports formatting](#formatting)
|
131
|
+
- [`timeStamp`](https://developers.google.com/web/tools/chrome-devtools/console/console-reference#timestamp)
|
132
|
+
- [`trace`](https://developers.google.com/web/tools/chrome-devtools/console/console-reference#trace)
|
133
|
+
see [known issues](#known-issues)
|
134
|
+
- [`warn`](https://developers.google.com/web/tools/chrome-devtools/console/console-reference#warn)
|
135
|
+
[also supports formatting](#formatting)
|
136
|
+
|
137
|
+
Also:
|
138
|
+
|
139
|
+
- [`profile` and `profileEnd`](https://developers.google.com/web/tools/chrome-devtools/console/console-reference#profile)
|
140
|
+
as well as
|
141
|
+
[`time` and `timeEnd`](https://developers.google.com/web/tools/chrome-devtools/console/console-reference#time)
|
142
|
+
support lambda syntax:
|
143
|
+
|
144
|
+
```js
|
145
|
+
logalize.profile('profile1')
|
146
|
+
myVar = myFunction()
|
147
|
+
logalize.profileEnd()
|
148
|
+
|
149
|
+
/* is the same as */
|
150
|
+
|
151
|
+
myVar = logalize.profile('profile1', myFunction)
|
152
|
+
```
|
153
|
+
|
154
|
+
- `group` is described in [grouping](#grouping).
|
155
|
+
|
156
|
+
### Initialization options
|
157
|
+
|
158
|
+
```js
|
159
|
+
logalize = new Logalize({
|
160
|
+
enabled: true,
|
161
|
+
enableFormatting: true,
|
162
|
+
collapseGroups: false,
|
163
|
+
modifyConsole: true
|
164
|
+
})
|
165
|
+
```
|
166
|
+
- `enabledByDefault`: Defines whether to enable or disable Logalize.
|
167
|
+
When Logalize is disabled, it will not produce any output. However, lambda versions of `profile`, `time` and `group` will still execute given functions. Default: `true`.
|
168
|
+
- `enableFormatting`: Defines whether [formatting](#formatting) should be enabled. Default: `true`.
|
169
|
+
- `collapseGroups`: Defines whether [groups](#grouping) should be
|
170
|
+
collapsed or not. Default: `false` (expanded).
|
171
|
+
- `modifyConsole`: Defines whether Logalize needs to modify `console` upon initialization.
|
172
|
+
Generally, modifying global objects is a bad thing to do, but this is required if you want Logalize to
|
173
|
+
handle console output correctly. Logalize is modifying `console` functions *very carefully* (it just
|
174
|
+
needs to hook to those methods). You can safely disable this options, but regular console output
|
175
|
+
will occasionally get stuck inside groups it does not belong to. see [known issues](#known-issues). Default: `true`.
|
176
|
+
|
177
|
+
### Grouping
|
178
|
+
|
179
|
+
Groups in Logalize work a little different from console's groups. There are two ways to group the output.
|
180
|
+
|
181
|
+
```js
|
182
|
+
/* method 1 */
|
183
|
+
logalize.group('group one').log('inside group 1')
|
184
|
+
|
185
|
+
/* method 2 */
|
186
|
+
logalize.group('group one', function () {
|
187
|
+
logalize.log('inside group 1')
|
188
|
+
})
|
189
|
+
```
|
190
|
+
|
191
|
+
You can easily mix methods together and nest groups however you want:
|
192
|
+
|
193
|
+
```js
|
194
|
+
logalize.group('user login', function () {
|
195
|
+
logalize.info('user login started')
|
196
|
+
logalize.group('credentials').log('credentials are [correct].green')
|
197
|
+
/* code */
|
198
|
+
logalize.info('[success].badge.green')
|
199
|
+
})
|
200
|
+
|
201
|
+
logalize.group('group 1').log('some more output')
|
202
|
+
logalize.group('group 1', 'another group!').log('still nested correctly')
|
203
|
+
```
|
204
|
+
|
205
|
+
Output:
|
206
|
+
|
207
|
+

|
208
|
+
|
209
|
+
When `document` is not in focus (e.g. your console is in focus), the output becomes:
|
210
|
+
|
211
|
+

|
212
|
+
|
213
|
+
This behaviour is explained in [known issues](#known-issues).
|
214
|
+
|
215
|
+
### Formatting
|
216
|
+
|
217
|
+
Logalize supports Markdown-like string formatting. Here's the options:
|
218
|
+
- `**bold**`
|
219
|
+
- `*italic*`
|
220
|
+
- `~strikethrough~`
|
221
|
+
- `_underline_`
|
222
|
+
- `[custom text].classOne.classTwo...`. This syntax allows you to apply CSS classes to text in
|
223
|
+
square brackets. Available classes are: `badge`, `bold`, `italic`, `strikethrough`, `underline` and [color classes](#color-classes).
|
224
|
+
|
225
|
+
At the moment, you cannot nest formatting options into each other.
|
226
|
+
Objects and functions are not formattable, but they likely will be in the future.
|
227
|
+
|
228
|
+
#### Color classes
|
229
|
+
|
230
|
+
Logalize supports following color classes (both for badges and normal text):
|
231
|
+
- `.blue`
|
232
|
+
- `.orange`
|
233
|
+
- `.red`
|
234
|
+
- `.green`
|
235
|
+
- `.cyan`
|
236
|
+
- `.purple`
|
237
|
+
|
238
|
+
#### Adding custom / overriding existing styles
|
239
|
+
|
240
|
+
All styles are declared in a stylesheet and thus are easily extensible.
|
241
|
+
See [`index.scss`](index.scss).
|
242
|
+
At the moment, only these attributes are supported: `margin`, `color`, `background-color`,
|
243
|
+
`border-radius`, `padding`, `font-weight`, `font-style`, `text-decoration`.
|
244
|
+
|
245
|
+
## Known issues
|
246
|
+
|
247
|
+
- **There's no way to detect when console output happens**. Development tools are separate from `window` and `document`,
|
248
|
+
and there is no way to know if the output is happening. We can detect things like `console.log`
|
249
|
+
by modifying those functions (hence the `modifyConsole` init parameter), but we cannot know when,
|
250
|
+
say, an error thrown with `throw` is going to appear in console. Groups are implemented in such a way that they don't get closed
|
251
|
+
until it's necessary, so that leads to console output being stuck inside groups it doesn't belong to.
|
252
|
+
Part of the problem is solved by modifying `console`, but another part is not solvable without a browser extension.
|
253
|
+
The best we can do is to detect whether or not `document` is in focus (with `document.hasFocus()`).
|
254
|
+
This enables us to change how groups work if `document` is not in focus (say, `console` is in focus).
|
255
|
+
However, some things (like `throw` or click on the "clear console" button) are simply not catchable.
|
256
|
+
So, **some output will inevitably get stuck in a group it doesn't belong**. Beware of this, especially when using `collapseGroups = true`.
|
257
|
+
|
258
|
+
- **Stack traces from `logalize.error` and `logalize.trace` contain unneeded information**.
|
259
|
+
Since `logalize.error` and `logalize.trace` call some functions under the hood, the stack trace produced
|
260
|
+
by those functions will contain several unneeded calls.
|
261
|
+
|
262
|
+
*All of this is according to the author's research. If you know a solution to this problem, you're
|
263
|
+
highly encouraged to open an issue and/or a pull request at [akxcv/logalize](https://github.com/akxcv/logalize).*
|
264
|
+
|
265
|
+
## Contributing
|
266
|
+
|
267
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/akxcv/logalize.
|
268
|
+
|
269
|
+
## License
|
270
|
+
|
271
|
+
The package is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
|
272
|
+
|
273
|
+
## TODO
|
274
|
+
|
275
|
+
- Support nested styles
|
276
|
+
- Log history
|
277
|
+
- Replace stylesheet with in-memory CSS?
|
278
|
+
- Focus mode (see only the logs you need **right now**)
|
279
|
+
- Custom styles in formatting (e.x. `[my text]{color: #434433;}`)
|
280
|
+
- Browser support
|
281
|
+
- Object and function formatting
|
data/lib/logalize.rb
ADDED
@@ -0,0 +1,13 @@
|
|
1
|
+
(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
|
2
|
+
window.Logalize=require("./index");
|
3
|
+
},{"./index":5}],2:[function(require,module,exports){
|
4
|
+
var BrowserAdapter={log:console.log,debug:console.debug,info:console.info,warn:console.warn,error:console.error,group:console.group,groupCollapsed:console.groupCollapsed,groupEnd:console.groupEnd,assert:console.assert,count:console.count,dir:console.dir,dirxml:console.dirxml,profile:console.profile,profileEnd:console.profileEnd,time:console.time,timeEnd:console.timeEnd,timeStamp:console.timeStamp,trace:console.trace};module.exports=BrowserAdapter;
|
5
|
+
|
6
|
+
},{}],3:[function(require,module,exports){
|
7
|
+
var Formatter={format:function(t){var e,r=[],a=[],s=0;for(var o in t){var n=this.formatObject(t[o]);if("undefined"==typeof n||!n[1].length)break;r.push(n[0]),a.push.apply(a,n[1]),s+=1}return t.splice(0,s),e=[],r.length&&(e.push(r.join(" ")),e.push.apply(e,a)),e.push.apply(e,t),e},formatObject:function(t){if("string"==typeof t)return this.formatString(t)},formatString:function(t){for(var e,r=[];this.canFormat(t);){var a=this.getRelevantMatch(t);e="string"==typeof a.format.classes?a.format.classes:a.format.classes(a.match),t=t.replace(a.format.regex,function(t,e){return"%c"+e+"%c"}),r.push(this.computeStyle(e)),r.push(this.computeStyle("default"))}return[t,r]},canFormat:function(t){for(var e in this.formats)if(this.formats[e].regex.test(t))return!0;return!1},getRelevantMatch:function(t){var e=[];for(var r in this.formats){var a=this.formats[r];a.regex.test(t)&&e.push({match:t.match(a.regex),format:a})}return e.sort(function(t,e){return t.match.index-e.match.index})[0]},computeStyle:function(t){var e=document.createElement("div");e.id="logalize",e.className=t,e.style="display: none;",document.getElementsByTagName("body")[0].appendChild(e);var r=getComputedStyle(e),a=[];for(var s in this.supportedStyles){var o=this.supportedStyles[s];a.push(o+":"+r.getPropertyValue(o))}return a.join(";")},supportedStyles:["margin","color","background-color","border-radius","padding","font-weight","font-style","text-decoration"],formats:[{regex:/\*\*([^\*]+)\*\*/,classes:"bold"},{regex:/\*([^\*]+)\*/,classes:"italic"},{regex:/~([^~]+)~/,classes:"strikethrough"},{regex:/_([^_]+)_/,classes:"underline"},{regex:/\[([^\[\]]+)\](\.[\.\w]+)/,classes:function(t){return t[2].split(".").join(" ")}}]};module.exports=Formatter;
|
8
|
+
|
9
|
+
},{}],4:[function(require,module,exports){
|
10
|
+
var BrowserAdapter=require("./browserAdapter"),GroupManager={currentStack:[],previousStack:[],globalStack:[],bindEvents:function(){var r=this;window.addEventListener("blur",function(){r.clear()})},group:function(r,t,e){if(e?(this.ungroup(!1),this.globalStack.push(t)):this.currentStack=t,document.hasFocus()){var o;if(e)for(o in t)BrowserAdapter[r](t[o]);else{var a=0;for(o in this.currentStack)this.previousStack[o]===this.currentStack[o]&&(a+=1);var n=this.previousStack.length-a;for(o=0;o<n;o++)BrowserAdapter.groupEnd();var c=this.currentStack.slice(a);for(o in c)BrowserAdapter[r](c[o])}}},ungroup:function(r){if(this.previousStack.length&&!this.currentStack.length&&this.previousStack.forEach(function(){BrowserAdapter.groupEnd()}),r){var t=this.globalStack.pop();t.forEach(function(){BrowserAdapter.groupEnd()})}this.previousStack=this.currentStack,this.currentStack=[]},clear:function(){this.previousStack.forEach(function(){BrowserAdapter.groupEnd()}),this.currentStack.forEach(function(){BrowserAdapter.groupEnd()}),this.previousStack=[]}};module.exports=GroupManager;
|
11
|
+
},{"./browserAdapter":2}],5:[function(require,module,exports){
|
12
|
+
function Logalize(o){var e={enabled:!0,enableFormatting:!0,collapseGroups:!1,modifyConsole:!0};o||(o={});for(var r in e)o.hasOwnProperty(r)||(o[r]=e[r]);if(this.enabled=o.enabled,this.enableFormatting=o.enableFormatting,this.collapseGroups=o.collapseGroups,this.formattableMethods=["log","info","debug","warn","error","focus"],GroupManager.bindEvents(),o.modifyConsole){var n=function(o,e){return GroupManager.clear(),BrowserAdapter[o].apply(BrowserAdapter,e)};console.log=function(){n("log",arguments)},console.debug=function(){n("debug",arguments)},console.info=function(){n("info",arguments)},console.warn=function(){n("warn",arguments)},console.error=function(){n("error",arguments)},console.assert=function(){n("assert",arguments)},console.clear=function(){GroupManager.clear()},console.count=function(){n("count",arguments)},console.dir=function(){n("dir",arguments)},console.dirxml=function(){n("dirxml",arguments)},console.group=function(){n("group",arguments)},console.groupCollapsed=function(){n("groupCollapsed",arguments)},console.groupEnd=function(){n("groupEnd",arguments)},console.profile=function(){n("profile",arguments)},console.profileEnd=function(){n("profileEnd",arguments)},console.time=function(){n("time",arguments)},console.timeEnd=function(){n("timeEnd",arguments)},console.timeStamp=function(){n("timeStamp",arguments)},console.trace=function(){n("trace",arguments)}}}var GroupManager=require("./groupManager"),BrowserAdapter=require("./browserAdapter"),Formatter=require("./formatter");Logalize.prototype={log:function(){this.print("log",[].slice.call(arguments))},debug:function(){this.print("debug",[].slice.call(arguments))},info:function(){this.print("info",[].slice.call(arguments))},warn:function(){this.print("warn",[].slice.call(arguments))},error:function(){this.print("error",[].slice.call(arguments))},assert:function(){this.print("assert",[].slice.call(arguments))},count:function(o){this.print("count",[o])},dir:function(o){this.print("dir",[o])},dirxml:function(o){this.print("dirxml",[o])},profile:function(){var o=[].slice.call(arguments),e=o.pop();if("function"==typeof e){this._isEnabled()&&BrowserAdapter.profile(o[0]);var r=e.call();return this.profileEnd(),r}this._isEnabled()&&BrowserAdapter.profile(o[0])},profileEnd:function(){this._isEnabled()&&BrowserAdapter.profileEnd()},time:function(){var o=[].slice.call(arguments),e=o.pop();if("function"==typeof e){this._isEnabled()&&BrowserAdapter.time(o[0]);var r=e.call();return this.timeEnd(o[0]),r}this._isEnabled()&&BrowserAdapter.time(o[0])},timeEnd:function(o){this._isEnabled()&&BrowserAdapter.timeEnd(o)},timeStamp:function(o){this._isEnabled()&&BrowserAdapter.timeStamp(o)},trace:function(o){this.print("trace",[o])},group:function(){var o=[].slice.call(arguments),e=this.collapseGroups?"groupCollapsed":"group";if("function"==typeof o[o.length-1]){var r=o.pop();this._isEnabled()&&GroupManager.group(e,o,!0);var n=r.call();return this._isEnabled()&&GroupManager.ungroup(!0),n}return this._isEnabled()&&GroupManager.group(e,o),this},print:function(o,e){if(GroupManager.ungroup(),this._isEnabled()){var r=!document.hasFocus()&&GroupManager.previousStack.length+GroupManager.globalStack.length;if(r){var n=[],t=GroupManager.previousStack;t.unshift.apply(t,GroupManager.globalStack.reduce(function(o,e){return o.concat(e)},[])),GroupManager.previousStack=[];for(var i in t)n.push(t[i]);var a=n.join(" -> ")+" :: ";"string"==typeof e[0]?e[0]=a+e[0]:e.unshift(a)}this.formattableMethods.indexOf(o)>-1&&this.enableFormatting&&(e=Formatter.format(e)),r?(BrowserAdapter.groupCollapsed.apply(BrowserAdapter,e),BrowserAdapter.groupEnd()):BrowserAdapter[o].apply(BrowserAdapter,e)}},enable:function(){localStorage&&localStorage.setItem("logalizeEnabled","true")},disable:function(){localStorage&&localStorage.setItem("logalizeEnabled","false")},_isEnabled:function(){return localStorage&&localStorage.logalizeEnabled?"false"!==localStorage.logalizeEnabled:this.enabled}},module.exports=Logalize;
|
13
|
+
},{"./browserAdapter":2,"./formatter":3,"./groupManager":4}]},{},[1]);
|
@@ -0,0 +1,55 @@
|
|
1
|
+
#logalize {
|
2
|
+
color: black;
|
3
|
+
background-color: transparent;
|
4
|
+
border-radius: 0;
|
5
|
+
padding: 0;
|
6
|
+
margin: 0;
|
7
|
+
font-weight: normal;
|
8
|
+
font-style: normal; }
|
9
|
+
#logalize.badge {
|
10
|
+
color: white;
|
11
|
+
background-color: black;
|
12
|
+
border-radius: 3px;
|
13
|
+
padding: 2px;
|
14
|
+
margin: 0 2px; }
|
15
|
+
#logalize.badge.blue {
|
16
|
+
color: white;
|
17
|
+
background-color: #61afef; }
|
18
|
+
#logalize.badge.orange {
|
19
|
+
color: white;
|
20
|
+
background-color: #d19a66; }
|
21
|
+
#logalize.badge.red {
|
22
|
+
color: white;
|
23
|
+
background-color: #e06c75; }
|
24
|
+
#logalize.badge.green {
|
25
|
+
color: white;
|
26
|
+
background-color: #98c379; }
|
27
|
+
#logalize.badge.cyan {
|
28
|
+
color: white;
|
29
|
+
background-color: #56b6c2; }
|
30
|
+
#logalize.badge.purple {
|
31
|
+
color: white;
|
32
|
+
background-color: #c678dd; }
|
33
|
+
#logalize.badge.focus {
|
34
|
+
color: #bada55;
|
35
|
+
background: #444; }
|
36
|
+
#logalize.blue {
|
37
|
+
color: #4078f2; }
|
38
|
+
#logalize.orange {
|
39
|
+
color: #986801; }
|
40
|
+
#logalize.red {
|
41
|
+
color: #e45649; }
|
42
|
+
#logalize.green {
|
43
|
+
color: #50a14f; }
|
44
|
+
#logalize.cyan {
|
45
|
+
color: #0184bc; }
|
46
|
+
#logalize.purple {
|
47
|
+
color: #a626a4; }
|
48
|
+
#logalize.bold {
|
49
|
+
font-weight: bold; }
|
50
|
+
#logalize.italic {
|
51
|
+
font-style: italic; }
|
52
|
+
#logalize.strikethrough {
|
53
|
+
text-decoration: line-through; }
|
54
|
+
#logalize.underline {
|
55
|
+
text-decoration: underline; }
|
metadata
ADDED
@@ -0,0 +1,53 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: logalize
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Alexander Komarov
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2017-02-14 00:00:00.000000000 Z
|
12
|
+
dependencies: []
|
13
|
+
description: |-
|
14
|
+
Logalize is a Javascript wrapper for browser's developer console.
|
15
|
+
Its goal is to make debugging easier.
|
16
|
+
email:
|
17
|
+
- ak@akxcv.com
|
18
|
+
executables: []
|
19
|
+
extensions: []
|
20
|
+
extra_rdoc_files: []
|
21
|
+
files:
|
22
|
+
- README.md
|
23
|
+
- lib/logalize.rb
|
24
|
+
- lib/logalize/rails.rb
|
25
|
+
- lib/logalize/rails/engine.rb
|
26
|
+
- lib/logalize/rails/version.rb
|
27
|
+
- vendor/assets/javascripts/logalize.js
|
28
|
+
- vendor/assets/stylesheets/logalize.css
|
29
|
+
homepage: https://github.com/akxcv/logalize
|
30
|
+
licenses:
|
31
|
+
- MIT
|
32
|
+
metadata: {}
|
33
|
+
post_install_message:
|
34
|
+
rdoc_options: []
|
35
|
+
require_paths:
|
36
|
+
- lib
|
37
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
38
|
+
requirements:
|
39
|
+
- - ">="
|
40
|
+
- !ruby/object:Gem::Version
|
41
|
+
version: '0'
|
42
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
43
|
+
requirements:
|
44
|
+
- - ">="
|
45
|
+
- !ruby/object:Gem::Version
|
46
|
+
version: '0'
|
47
|
+
requirements: []
|
48
|
+
rubyforge_project:
|
49
|
+
rubygems_version: 2.6.8
|
50
|
+
signing_key:
|
51
|
+
specification_version: 4
|
52
|
+
summary: Make your console great again
|
53
|
+
test_files: []
|