# Introduction

Logging is a basic need. This chapter describes how it is done on the different platforms.

iOS and OSX use the Apple Unified Logging System. Logs can be displayed using the OSX Console. See

  • Apple logging documentation https://developer.apple.com/documentation/os/logging and

  • OSX Console information https://support.apple.com/guide/console/welcome/mac

Android logs are written into the Android Log System and displayed using LogCat. See here for an introduction

  • https://developer.android.com/reference/android/util/Log

Please find the Source code here

https://github.com/scadedoc/UgExamples/tree/master/UgLogging See [Installing examples](🔗) for information on how to download the examples.

# Logging.swift helper class

We currently use a helper class for logging. Please copy this class into your project. Logging.swift at https://github.com/scadedoc/ScadeUtilities/blob/master/Sources/ScadeUtilities/Logging.swift

# Getting started

To log, use the **os_log** function. To write message to the log, you use



You can use the default logging levels and all the logs you write show up on the different platforms:

  • for SCADE Simulator, log output shows in the SCADE IDE console and the OSX Console

  • for iOS Simulator, log output shows in the SCADE IDE console and the OSX Console

  • for iOS Devices, log output shows in the OSX Console

  • for Android Simulator, log output shows in the SCADE IDE console and Android logcat

  • for Android devices, log output shows in Android logcat



# SCADE Simulator

The SCADE Simulator writes the log into the OSX Console and the SCADE IDE console.

(Script tags will be stripped)


# iOS Simulator

When running the app, you find the output in the OSX Console

(Script tags will be stripped)


# Android logs

The log messages are written into the Android log. Each os_log invocation results into a logging message with the same logging level

OSLogTypeAndroid Log severity
.infoInformation
.debugDebug
.errorError
.faultFatal (not exposed in Java API)
.defaultInformation
not supportedVerbose
not supportedAssert

SCADE writes messages into logcat and outputs same messages into SCADE IDE console:

(Script tags will be stripped)