Skip to content

Quick start

Rakuyo edited this page Nov 3, 2020 · 4 revisions

The following content will tell you how to use the library, but basically does not involve "why do this" and "what does this type mean".

See other wikis for more details. For complete code examples, please refer to the demo provided with the repository (under the ʻExamples` directory).

Print Log

Output to the console

RaLog provides Log type, which can be used to print logs:

Log.debug("This is a log.")

After running the above code in the Debug environment, the following will be output in the console:

(RaLog does not print logs by default in Release environment)

[↓ In `viewDidLoad()` of ViewController.swift:32 ↓]
[RaLog] 11:17:01:353 <👾 Debug> : This is a log.

Log Flags

In addition to the debug flag used above, RaLog also provides other 6 log flags. The complete list of flags is as follows:

Name Output Call Method Parameter
debug 👾 Debug Log.debug(...) Any?
warning ⚠️ Warning Log.warning(...) Any?
success ✅ Success Log.success(...) Any?
error ❌ Error Log.error(...) Any?
deinit ⁉️ Deinit Log.deinit(...) AnyObject?
jump 👋 Jump Log.appear(...), Log.disappear(...) UIViewController Generic
javascript 🔥 Javascript Log.javascript(...) Any?
Clone this wiki locally