Skip to content

Commit e9cc82a

Browse files
committed
Internal logger logLog added
1 parent 781e4c2 commit e9cc82a

File tree

2 files changed

+39
-27
lines changed

2 files changed

+39
-27
lines changed

log4javascript/log4javascript-tests.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/// <reference path="log4javascript.d.ts" />
1+
/// <reference path="./log4javascript.d.ts" />
22

33
function aSimpleLoggingMessageString() {
44
var log = log4javascript.getDefaultLogger();
@@ -47,4 +47,8 @@ function changingTheFormatOfLogMessages() {
4747
var popUpAppender = new log4javascript.PopUpAppender();
4848
var layout = new log4javascript.PatternLayout("[%-5p] %m");
4949
popUpAppender.setLayout(layout);
50+
}
51+
52+
function configureLogLog() {
53+
log4javascript.logLog.setQuietMode(true);
5054
}

log4javascript/log4javascript.d.ts

Lines changed: 34 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1051,38 +1051,46 @@ declare module log4javascript {
10511051
// #region log4javascript error handling
10521052

10531053
/**
1054-
* Sets whether LogLog is in quiet mode or not. In quiet mode, no messages sent to LogLog have any visible effect. By default,
1055-
* quiet mode is switched off.
1056-
* @param quietMode Whether to turn quiet mode on or off.
1054+
* log4javascript has a single rudimentary logger-like object of its own to handle messages generated by log4javascript itself.
1055+
* This logger is called logLog and is accessed via log4javascript.logLog.
10571056
*/
1058-
export function setQuietMode(quietMode: boolean): void;
1057+
export namespace logLog {
10591058

1060-
/**
1061-
* Sets how many errors LogLog will display alerts for. By default, only the first error encountered generates an alert to the
1062-
* user. If you turn all errors on by supplying true to this method then all errors will generate alerts.
1063-
* @param showAllErrors Whether to show all errors or just the first.
1064-
*/
1065-
export function setAlertAllErrors(alertAllErrors: boolean): void;
1059+
/**
1060+
* Sets whether logLog is in quiet mode or not. In quiet mode, no messages sent to logLog have any visible effect. By default,
1061+
* quiet mode is switched off.
1062+
* @param quietMode Whether to turn quiet mode on or off.
1063+
*/
1064+
export function setQuietMode(quietMode: boolean): void;
10661065

1067-
/**
1068-
* Logs a debugging message to an in-memory list.
1069-
*/
1070-
export function debug(message: string, exception?: Error): void;
1066+
/**
1067+
* Sets how many errors logLog will display alerts for. By default, only the first error encountered generates an alert to the
1068+
* user. If you turn all errors on by supplying true to this method then all errors will generate alerts.
1069+
* @param showAllErrors Whether to show all errors or just the first.
1070+
*/
1071+
export function setAlertAllErrors(alertAllErrors: boolean): void;
10711072

1072-
/**
1073-
* Displays an alert of all debugging messages.
1074-
*/
1075-
export function displayDebug(): void;
1073+
/**
1074+
* Logs a debugging message to an in-memory list.
1075+
*/
1076+
export function debug(message: string, exception?: Error): void;
10761077

1077-
/**
1078-
* Currently has no effect.
1079-
*/
1080-
export function warn(message: string, exception?: Error): void;
1078+
/**
1079+
* Displays an alert of all debugging messages.
1080+
*/
1081+
export function displayDebug(): void;
10811082

1082-
/**
1083-
* Generates an alert to the user if and only if the error is the first one encountered and setAlertAllErrors(true) has not been called.
1084-
*/
1085-
export function error(message: string, exception?: Error): void;
1083+
/**
1084+
* Currently has no effect.
1085+
*/
1086+
export function warn(message: string, exception?: Error): void;
1087+
1088+
/**
1089+
* Generates an alert to the user if and only if the error is the first one encountered and setAlertAllErrors(true) has not been called.
1090+
*/
1091+
export function error(message: string, exception?: Error): void;
1092+
1093+
}
10861094

10871095
// #endregion
10881096
}

0 commit comments

Comments
 (0)