Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
3pia
VISPA
VISPA web
Commits
8dee684d
Commit
8dee684d
authored
Apr 17, 2015
by
Marcel Rieger
Browse files
Update jquery logger plugin to v0.4.0.
parent
c5695a2e
Changes
1
Hide whitespace changes
Inline
Side-by-side
vispa/static/vendor/jquery/plugins/logger/jquery.logger.js
View file @
8dee684d
/*!
* jQuery Logging Plugin v0.
3.2
* jQuery Logging Plugin v0.
4.0
* https://github.com/riga/jquery.logger
*
* Copyright 2015, Marcel Rieger
* Dual licensed under the MIT or GPL Version 3 licenses.
* http://www.opensource.org/licenses/mit-license
* http://www.opensource.org/licenses/GPL-3.0
* MIT licensed, http://www.opensource.org/licenses/mit-license
*
*/
...
...
@@ -31,14 +29,17 @@
// use appropriate console logging methods instead of the standard log method,
// the mapping is defined in `consoleMethods`
c
onsoleMethods
:
true
,
useC
onsoleMethods
:
true
,
// use timestamps in logs
timestamps
:
true
,
// show namespaces in logs
showNamespace
:
true
,
// show timestamps in logs
showTimestamp
:
true
,
// experimental
// show file name and line number of the origin
o
rigin
:
true
showO
rigin
:
true
};
...
...
@@ -250,7 +251,7 @@
// define a new logger
self
=
{
// current state
_enabled
:
tru
e
,
_enabled
:
fals
e
,
// current level
_level
:
"
all
"
,
...
...
@@ -343,21 +344,23 @@
var
prefix
=
""
;
// timestamp
if
(
options
.
t
imestamp
s
)
{
if
(
options
.
showT
imestamp
)
{
prefix
+=
"
[
"
+
timestamp
()
+
"
]
"
;
}
// level
prefix
+=
level
.
toUpperCase
()
+
"
-
"
;
prefix
+=
level
.
toUpperCase
();
// namespace w/o global namespace
var
namespace
=
self
.
namespace
();
if
(
self
!=
globalLogger
)
{
namespace
=
namespace
.
substr
(
options
.
global
.
length
+
options
.
delimitter
.
length
);
if
(
options
.
showNamespace
)
{
var
namespace
=
self
.
namespace
();
if
(
self
!=
globalLogger
)
{
namespace
=
namespace
.
substr
(
options
.
global
.
length
+
options
.
delimitter
.
length
);
}
prefix
+=
"
-
"
+
namespace
;
}
prefix
+=
namespace
+
"
"
;
return
prefix
+
"
-
"
;
return
prefix
+
"
-
"
;
},
// creates the postfix for all logs (origin)
...
...
@@ -365,7 +368,7 @@
var
postfix
=
[];
// origin
if
(
options
.
o
rigin
)
{
if
(
options
.
showO
rigin
)
{
var
origin
=
getOrigin
();
if
(
origin
!=
null
)
{
postfix
.
push
(
origin
);
...
...
@@ -411,7 +414,7 @@
// determine the log method to use
var
method
=
"
log
"
;
if
(
options
.
c
onsoleMethods
)
{
if
(
options
.
useC
onsoleMethods
)
{
var
consoleMethod
=
consoleMethods
[
level
.
toLowerCase
()];
if
(
consoleMethod
in
window
.
console
)
{
...
...
@@ -461,6 +464,10 @@
if
(
namespace
==
options
.
global
)
{
globalLogger
=
self
;
// the global logger is enabled by default
self
.
enable
();
}
else
{
// find the proper parent logger
var
parts
=
namespace
.
split
(
options
.
delimitter
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment