Indigo

Indigo

  • Blog
  • Guides
  • Docs
  • APIs
  • Tools
  • GitHub

›Platform & Publishing

Indigo

  • Indigo's Development Status

Getting started

  • Setup & Configuration
  • Hello, Indigo!
  • Examples
  • Mill & SBT Game Templates

Organising your game

  • Boot & Start Up
  • Game Entry Points
  • Scenes & Scene Management
  • SubSystems

The game loop

  • Events
  • Frame context
  • Outcome Type

Presentation

  • Animation
  • Audio
  • Boundaries
  • Cameras
  • Clones & Mutants
  • Depth
  • Layers
  • Lighting
  • Materials
  • Primitives & Building Blocks
  • SceneUpdateFragment
  • Shapes
  • Text & Fonts

UI Components

  • Overview
  • Buttons
  • Hit Area
  • Input Field
  • Radio Button

Shaders

  • Shaders Overview
  • Shader Constants, Variables, and Outputs
  • Blending
  • Premultiplied Alpha

Working with Time

  • Signals & Signal Functions
  • Time Varying Values

Platform & Publishing

  • Assets & Asset Loading
  • Cross Platform Publishing
  • File Format Importers
  • User Input Handling
  • Loading & Saving Data
  • Logging
  • Networking

Other information

  • Alternatives to Indigo
  • Glossary
  • Key Concepts
  • Model, ViewModel, & View
  • Anti-Patterns
  • Motivation & Constraints
  • Performance
  • Prior Art
  • Rendering Technology

Logging

Sometimes you need a log message to help you debug something, and to help you do that Indigo comes with a very simple / border-line dumb logger.

Logging

To write to the console in scala.js you can just use the usual Scala println, so why use a logger? Well there's one key advantage: Games update many times a second, and it's very easy to get accidentally flooded with log messages.

To help with that, along with the usual logger methods, we've added the errorOnce and debugOnce methods. These methods keep a cache of what they've logged, and only log the same string one time. So if you've got a busy process you can still can sane logs to read through.

Danger! That does mean that if every log is unique you'll not only be flooded with log messages, but you'll also be filling up your memory with cache entries!

The available logging options are:

import indigo.IndigoLogger.*

consoleLog("message to log")
info("message to log")
error("message to log")
errorOnce("message to log")
debug("message to log")
debugOnce("message to log")

Log Format

Logs are currently written out in a fixed format:

s"""[${system time millis}] [$level] [Indigo] $message"""

info,error, and debug are just levels you can log at, although this is purely for visual information as the logger has no configuration to change logging levels.

consoleLog prints to standard out (console.log in JavaScript) without any log message formatting.

← Loading & Saving DataNetworking →
  • Logging
  • Log Format
Indigo
Getting Started
Setup & Configuration Guide"Hello, Indigo!" TutorialLinks to examplesProject templates
Community
DiscordGitHub DiscussonsTwitter
Sponsor us!
GitHub SponsorsPatreon