🗡️
ConanJs
  • What is ConanJs?
  • Why ConanJs...
    • ... if coming from Redux
    • ... if using vanilla React
    • ... if learning React
    • ... if not using React
  • How to install/use ConanJs
  • About us / Github / Contact us
  • Demos
    • Demo Gallery
    • Conan State Demos
      • Hello World
      • Todos
        • Todos - Basic
        • Todos - Async
        • Todos - Optimistic
      • Github issues viewer
    • Conan Flow Demos
      • Authentication
  • CONAN DATA
    • General Concepts
    • Conan State
      • Actions & Reducers
        • Reducers
        • Actions
      • Creating State
      • Observing State
        • Live rendering
        • Connecting
      • Composing State
      • Scaling State
      • Orchestrating State
      • Life cycle
        • Async handling
        • Introspection
      • Testing state
    • Conan Flow
      • Creating Flows
      • Serialising Flows
      • Observing Flows
  • CONAN Runtime
  • Dependency Injection
    • General Concepts
    • Creating the Context
    • Using the Context
  • ASAPs
  • Logging
  • API
    • Main Classes
      • Conan
        • StateDef
      • ConanState
      • ConanFlow
        • UserFlowDef
        • UserStatusDef
        • Status
    • Conan State Classes
      • Thread
      • ConnectedState
      • MonitorInfo
      • MetaInfo
    • Dependency Injection
      • DiContextFactory
    • ASAPS
      • Asaps
      • Asap
Powered by GitBook
On this page
  • Introduction
  • Anatomy
  • Nature (Where?)
  • Level (How important?)
  • shortDesc
  • payload
  • Fine tuning Logging.
  • Demo

Was this helpful?

Logging

Introduction

Logging is built-in with ConanJs to provide you with an integrated platform so that you can:

  • Log meaningful message easily

  • Log what is happening internally in ConanJs

  • Fine tune at runtime what should be logged.

ConanData and Asaps both produce ConanJs log messages out of the box.

As of v1.0 dependency injection does not log anything at the moment, but this will be the case soon.

Anatomy

A logging message has many attributes that are helpful to understand where the message comes from, its information, and also, to make easier to fine tune what should be logged out.

Nature (Where?)

Indicates the nature of the source of this log message. There are seven natures:

Name

Source

MAIN

META

ASYNC

HELPER

ASAP

AUX

Derived from a Conan State that is created internally by the framework (you are likely to want to have this always turned off)

Level (How important?)

There are 7 levels. In order of importance (from less important to more important):

  • DEBUG

  • TRACE

  • INFO

  • MILESTONE

  • WARN

  • ERROR

shortDesc

A string message describing what is happening

payload

Optionally, there can a payload that will also get logged out.

Fine tuning Logging.

You can configure what to log at runtime. By default it gets log out everything that is:

MAIN and MILESTONE

To fine tune what gets logged out there are three main methods

updateLoggingFilter

Receives the current rules for logging, returns the new rules for logging

setLoggingFilter

Sets the logging rules

getLoggingFilter

Get the current rules.

Demo

The following example illustrates how to change the logging levels at runtime

PreviousASAPsNextMain Classes

Last updated 4 years ago

Was this helpful?

The in a Conan state

The in a Conan state

The in a Conan state

The in a Conan state (when the user decides to override the nature)

Log message from an .

main thread
meta flow
monitor thread
main thread
ASAP