-
-
Notifications
You must be signed in to change notification settings - Fork 98
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #439 from MohamedHarmoush/documentation/logging
Add documentation for `logging` package in `hexagon_core` module (issue #271)
- Loading branch information
Showing
9 changed files
with
152 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,28 @@ | ||
package com.hexagonkt.logging | ||
|
||
/** | ||
* A Logger is used to log messages for a specific system or application component. | ||
*/ | ||
interface LoggerPort { | ||
|
||
/** | ||
* Log a message, with associated exception information. | ||
* | ||
* @param [level] One of the message level identifiers, e.g., TRACE. | ||
* @param [exception] The exception associated with log message. | ||
* @param [message] The required message to log. | ||
* | ||
* @see [LoggingLevel] | ||
*/ | ||
fun <E : Throwable> log(level: LoggingLevel, exception: E, message: (E) -> Any?) | ||
|
||
/** | ||
* Log a message | ||
* | ||
* @param [level] One of the message level identifiers, e.g., TRACE. | ||
* @param [message] The required message to log. | ||
* | ||
* @see [LoggingLevel] | ||
*/ | ||
fun log(level: LoggingLevel, message: () -> Any?) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,26 @@ | ||
package com.hexagonkt.logging | ||
|
||
/** | ||
* Logging Contract for: | ||
* - Creating logger [createLogger]. | ||
* - Setting the logging level [setLoggerLevel]. | ||
*/ | ||
interface LoggingPort { | ||
|
||
/** | ||
* Creates [LoggerPort] by name. | ||
* | ||
* @param [name] Logger name. | ||
*/ | ||
fun createLogger(name: String): LoggerPort | ||
|
||
/** | ||
* Indicates logging level of a logger. | ||
* | ||
* @param [name] Logger name. | ||
* @param [level] One of the logging levels identifiers, e.g., TRACE | ||
* | ||
* @see [LoggingLevel] | ||
*/ | ||
fun setLoggerLevel(name: String, level: LoggingLevel) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters