B2Win Suite Documentation (Under Construction)
ContactB2Data
5.2
5.2
  • B2Win Suite Documentation
  • Scripting
    • B2Win Suite Scripting Overview
    • Scripting in B2Data
      • Custom Script Nodes
        • Custom Script
        • Source Script Node (File)
        • Source Script Node (Table)
        • Source Script Node (Object)
        • If-Else Condition
        • Condition Node
      • In DataPrep
      • Properties
      • Workflow Applications
        • Workflow #1
        • Workflow #2
    • Getting Started
    • Language Basics
    • Data Types and Data Structures
      • Primitive Data Types
      • Data Structures
      • SuiteTable
      • Row, Column, StringColumn
    • Non-static Classes
      • Instant Class
      • LocalDateTime
      • LocalDate
      • LocalTime
      • JsonNode Class
      • File Class
    • Static Classes
      • Duration Class
      • Math Class
      • StrictMath Class
      • InstantUtil
      • NumericUtil
      • GeneralDateUtil
      • LocalDateTimeUtil
      • LocalDateUtil
      • LocalTimeUtil
      • DbUtil
      • StateUtil
      • FileUtil
      • JsonUtil
      • HttpUtil
      • NodeInputReader
      • RandomUtil
    • Property Class
    • Context and System
      • Context Class
      • System Class
    • Logging and Configuration
      • Logging
      • Configuration
    • Tutorial
    • Feedback
Powered by GitBook
On this page
  • Logger Class
  • Methods

Was this helpful?

  1. Scripting
  2. Logging and Configuration

Logging

Logger Class

The Logger class is designed to facilitate logging within your application. It provides various log levels to categorize and differentiate the type and severity of log messages.

You can use this class to record important information, debug messages, warnings, and errors during the execution of your application.

Methods

info(format: String, ...args?: any[]): void

Use this method to log informational messages. It accepts a format string and optional additional arguments that can be interpolated into the format string.

These messages are typically used to convey important details about the application's operation.

// Log informational message
Logger.info("This is an informational message.");

debug(format: String, ...args?: any[]): void

The debug method is intended for logging debugging messages. Like info, it also accepts a format string and optional arguments.

Debugging messages help developers understand the inner workings of the application and troubleshoot issues during development and testing.

// Log debugging message with interpolated argument
var variable = 42;
Logger.debug("Debugging message: %s", variable);

warn(format: String, ...args?: any[]): void

To log warning messages, use the warn method. It accepts a format string and optional arguments.

Warning messages are crucial for notifying users or developers about potential issues that do not disrupt the application's flow but should be addressed.

// Log a warning message
Logger.warn("Warning: Something might be wrong.");

error(format: String, ...args?: any[]): void

The error method is designed to log error messages. It accepts a format string and optional arguments.

Error messages are essential for identifying critical issues that need immediate attention and resolution. They help pinpoint problems in the application.

// Log an error message
Logger.error("Error: Something went terribly wrong.");
PreviousLogging and ConfigurationNextConfiguration

Was this helpful?