Skip to content

Commit e329c70

Browse files
Merge pull request #3 from talis/LIG-405-AddOptionalDescription
90% - Lig 405 add optional description
2 parents fd086c8 + ef31034 commit e329c70

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

js/logging.js

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -91,10 +91,10 @@ loggingModule.factory(
9191
"applicationLoggingService",
9292
["$log","$window", "LOGGING_CONFIG", function($log, $window, LOGGING_CONFIG){
9393
return({
94-
error: function(message){
94+
error: function(message, desc){
9595
if (LOGGING_CONFIG.LOGGING_TYPE !== 'none') {
9696
// preserve default behaviour
97-
$log.error.apply($log, arguments);
97+
$log.error.apply($log, [message]);
9898
}
9999

100100
// check if the config says we should log to the remote, and also if a remote endpoint was specified
@@ -107,15 +107,16 @@ loggingModule.factory(
107107
data: angular.toJson({
108108
url: $window.location.href,
109109
message: message,
110-
type: "error"
110+
type: "error",
111+
desc: desc
111112
})
112113
});
113114
}
114115
},
115-
debug: function(message){
116+
debug: function(message, desc){
116117
if (LOGGING_CONFIG.LOGGING_LEVEL !== 'error') {
117118
if (LOGGING_CONFIG.LOGGING_TYPE !== 'none') {
118-
$log.log.apply($log, arguments);
119+
$log.log.apply($log, [message]);
119120
}
120121

121122
// check if the config says we should log to the remote, and also if a remote endpoint was specified
@@ -127,7 +128,8 @@ loggingModule.factory(
127128
data: angular.toJson({
128129
url: $window.location.href,
129130
message: message,
130-
type: "debug"
131+
type: "debug",
132+
desc: desc
131133
})
132134
});
133135
}
@@ -161,4 +163,4 @@ loggingModule.factory(
161163
}
162164
});
163165
}]
164-
);
166+
);

0 commit comments

Comments
 (0)