Provides a lightweight logging implementation for Swift which logs to standard output.
HeliumLogger package to the dependencies within your application’s
Package.swift file. Substitute
"x.x.x" with the latest
.package(url: "https://github.com/Kitura/HeliumLogger.git", from: "x.x.x")
HeliumLogger to your target's dependencies:
.target(name: "example", dependencies: ["HeliumLogger"]),
To use with LoggerAPI:
import HeliumLogger import LoggerAPI
To use with swift-log:
import HeliumLogger import Logging
To use HeliumLogger as a logging backend for LoggerAPI:
let logger = HeliumLogger() Log.logger = logger
or, if you don't need to customize
To use HeliumLogger as a logging backend for swift-log:
let logger = HeliumLogger() LoggingSystem.bootstrap(logger.makeLogHandler)
Or, as a convenience:
You can specify the level of output on initialization. You will see output of that level, and all levels below that.
The order is:
For example, this logger will show messages of type
let logger = HeliumLogger(.verbose) Log.logger = logger
In this example, the logger will only show messages of type
Note that when HeliumLogger is used in conjunction with swift-log, the logging level is determined by the
Logger, and HeliumLogger's own logging level is unused.
HeliumLogger.use(LoggerMessageType) will set the
LoggerAPI to use this new HeliumLogger instance. If in a route you detect an error with your application, you could use this to dynamically increase the log level.
This new instance will not have any customization which you applied to other instances (see list item 7).
How to use HeliumLogger to log messages in your application with LoggerAPI:
Log.verbose("This is a verbose log message.") Log.info("This is an informational log message.") Log.warning("This is a warning.") Log.error("This is an error.") Log.debug("This is a debug message.")
/// Whether, if true, or not the logger output should be colorized. public var colored: Bool = false /// If true, use the detailed format when a user logging format wasn't specified. public var details: Bool = true /// If true, use the full file path, not just the filename. public var fullFilePath: Bool = false /// If not nil, specifies the user specified logging format. /// For example: "[(%date)] [(%type)] [(%file):(%line) (%func)] (%msg)" public var format: String? /// If not nil, specifies the format used when adding the date and the time to the logged messages. public var dateFormat: String? /// If not nil, specifies the timezone used in the date time format. public var timeZone: TimeZone?
For more information visit our API reference.
We love to talk server-side Swift, and Kitura. Join our Slack to meet the team!
Source code: https://github.com/Kitura/HeliumLogger
License: Apache-2.0 license
Swift is a fast and efficient general-purpose programming language that provides real-time feedback and can be seamlessly incorporated into existing Objective-C code. This is why developers are able to write safer, more reliable code while saving time. It aims to be the best language that can be used for various purposes ranging from systems programming to mobile as well as desktop apps and scaling up to cloud services.
Below here, we list down the 10 best online resources to learn Swift language.
(The list is in no particular order)
#developers corner #free online resources to learn swift language #learn swift #learn swift free #learn swift online free #resources to learn swift #swift language #swift programming
A thoroughly researched list of top Swift developers with ratings & reviews to help find the best Swift development companies around the world.
#swift development service providers #best swift development companies #top swift development companies #swift development solutions #top swift developers #swift
Want to create a native iOS application for your Startup?
Hire Dedicated Swift Developers for end-to-end services like development, migration, upgrade, testing, and support & maintenance. Trust HourlyDeveloper.io our Swift development team for iOS device apps that are high on performance and security.
Consult with experts:- https://bit.ly/2C5M6cz
#hire dedicated swift developers #swift developers #swift development company #swift development services #swift development #swift
Hire an Exceptional Swift App Developer from Mobile App Development India. Maadi has a dedicated Swift App Development team that is superiorly talented and builds highly functional, cost-effective mobile apps with error-free coding.
#swift ios app development india #hire swift programmer india #swift ios development #apple swift app development #swift mobile app development #swift app development
Are you looking for the best Android app development frameworks? Get the best Android app development frameworks that help to build the top-notch Android mobile app.
For more info:
#best android mobile app development frameworks #top mobile app development frameworks #android app development frameworks #top frameworks for android app development #most popular android app development frameworks #app development frameworks