Skip to content

Quick start

Rakuyo edited this page Jan 23, 2024 · 4 revisions

The following will show you how to use the library, but will barely cover "why do this" and "what does this type mean".

See the other wiki for more details, and see the demo that comes with the repository (in the Demo directory) for full code examples.

Print Log

Output to Console

RaLog provides a Log type by which logs can be printed:

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

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

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

[↓ 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?