Latest 1.8.1
Homepage https://github.com/IBM-Swift/LoggerAPI
License Apache License, Version 2.0
Platforms osx 10.11, ios 10.0, tvos 9.1, watchos 2.0


Kitura


APIDoc


Build Status - Master

macOSLinuxApache 2
Slack Status

A logger protocol that provides a common logging interface for different kinds of loggers. In addition, a class with a set of static functions for logging within your code is provided.

Kitura uses this API throughout its implementation when logging.

Usage

Add dependencies

Add the LoggerAPI package to the dependencies within your application’s Package.swift file. Substitute "x.x.x" with the latest LoggerAPI release:

.package(url: "https://github.com/IBM-Swift/LoggerAPI.git", from: "x.x.x")

Add LoggerAPI to your target’s dependencies:

.target(name: "example", dependencies: ["LoggerAPI"]),

Import package

import LoggerAPI

Log messages

Add log messages to your application:

Log.warning("This is a warning.")
Log.error("This is an error.")

Define a logger

You need to define a logger in order to output these messages:

Log.logger = ...

You can write your own logger implementation. In the case of Kitura, it defines
HeliumLogger as the logger used by LoggerAPI. You can find out more about HeliumLogger here.

API documentation

For more information visit our API reference.

Community

We love to talk server-side Swift, and Kitura. Join our Slack to meet the team!

License

This library is licensed under Apache 2.0. Full license text is available in LICENSE.

Latest podspec

{
    "name": "LoggerAPI",
    "version": "1.8.1",
    "summary": "A logger protocol that provides a common logging interface for different kinds of loggers.",
    "homepage": "https://github.com/IBM-Swift/LoggerAPI",
    "license": {
        "type": "Apache License, Version 2.0"
    },
    "authors": "IBM",
    "module_name": "LoggerAPI",
    "platforms": {
        "osx": "10.11",
        "ios": "10.0",
        "tvos": "9.1",
        "watchos": "2.0"
    },
    "source": {
        "git": "https://github.com/IBM-Swift/LoggerAPI.git",
        "tag": "1.8.1"
    },
    "source_files": "Sources/LoggerAPI/*.swift"
}

Pin It on Pinterest

Share This