new Logger(prefix, level)
Parameters:
| Name | Type | Argument | Default | Description |
|---|---|---|---|---|
prefix |
string |
<optional> |
"" | All log messages will be prefixed with that. |
level |
Exitgames.Common.Logger.Level |
<optional> |
Level.INFO | Initial logging level. |
- Source:
- Photon-Javascript_SDK.js, line 31
Members
-
<static, readonly> Level
Logging levels. Set to restrict log output.
-
- Source:
- Photon-Javascript_SDK.js, line 225
Properties:
Name Type Description DEBUGnumber All logging methods enabled. INFOnumber info(...), warn(...), error(...) methods enabled. WARNnumber warn(...) and error(...) methods enabled. ERRORnumber Only error(...) method enabled. OFFnumber Logging off.
Methods
-
debug(mess, optionalParams)
Logs message if logging level = DEBUG, INFO, WARN, ERROR
-
Parameters:
Name Type Description messstring Message to log. optionalParamsany For every additional parameter toString() applies and result added to the end of log message after space character. - Source:
- Photon-Javascript_SDK.js, line 96
-
error(mess, optionalParams)
Logs message if logging level = ERROR
-
Parameters:
Name Type Description messstring Message to log. optionalParamsany For every additional parameter toString() applies and result added to the end of log message after space character. - Source:
- Photon-Javascript_SDK.js, line 135
-
exception(mess, optionalParams)
Throws an Error or executes exception handler if set.
-
Parameters:
Name Type Description messstring Message passed to Error or exception handler. optionalParamsany For every additional parameter toString() applies and result added to the end of log message after space character. - Source:
- Photon-Javascript_SDK.js, line 148
-
format(mess, optionalParams) → {string}
Applies default logger formatting to arguments
-
Parameters:
Name Type Description messstring String to start formatting with. optionalParamsany For every additional parameter toString() applies and result added to the end of formatted string after space character. - Source:
- Photon-Javascript_SDK.js, line 164
Returns:
Formatted string.- Type
- string
-
format(mess, optionalParams) → {string}
Applies default logger formatting to array of objects.
-
Parameters:
Name Type Description messstring String to start formatting with. optionalParamsany[] For every additional parameter toString() applies and result added to the end of formatted string after space character. - Source:
- Photon-Javascript_SDK.js, line 178
Returns:
Formatted string.- Type
- string
-
getLevel() → {Exitgames.Common.Logger.Level}
Returns current logging level.
-
- Source:
- Photon-Javascript_SDK.js, line 90
Returns:
Current logging level. -
getPrefix() → {string}
Gets logger prefix.
-
- Source:
- Photon-Javascript_SDK.js, line 57
Returns:
Prefix.- Type
- string
-
info(mess, optionalParams)
Logs message if logging level = INFO, WARN, ERROR
-
Parameters:
Name Type Description messstring Message to log. optionalParamsany For every additional parameter toString() applies and result added to the end of log message after space character. - Source:
- Photon-Javascript_SDK.js, line 109
-
isLevelEnabled(level) → {boolean}
Checks if logging level active.
-
Parameters:
Name Type Description levelExitgames.Common.Logger.Level Level to check. - Source:
- Photon-Javascript_SDK.js, line 83
Returns:
True if level active.- Type
- boolean
-
setExceptionHandler(handler)
Sets global method to be called on logger.exception call.
-
Parameters:
Name Type Description handler(string) => boolean Exception handler. Return true to cancel throwing. - Source:
- Photon-Javascript_SDK.js, line 75
-
setLevel(level)
Changes current logging level.
-
Parameters:
Name Type Description levelExitgames.Common.Logger.Level New logging level. - Source:
- Photon-Javascript_SDK.js, line 65
-
setPrefix(prefix)
Sets logger prefix.
-
Parameters:
Name Type Description prefixstirng New prefix. - Source:
- Photon-Javascript_SDK.js, line 49
-
warn(mess, optionalParams)
Logs message if logging level = WARN, ERROR
-
Parameters:
Name Type Description messstring Message to log. optionalParamsany For every additional parameter toString() applies and result added to the end of log message after space character. - Source:
- Photon-Javascript_SDK.js, line 122