tom_basics library
Basic utilities for the TOM framework.
This library provides foundational utilities that have minimal dependencies and can be used by other TOM framework packages:
- TomBaseException - Base exception class with UUID tracking
- TomLogger - Lightweight logging with configurable outputs
- TomPlatformUtils - Cross-platform utility abstractions
- TomEnvironment - Runtime environment configuration
Usage
import 'package:tom_basics/tom_basics.dart';
throw TomBaseException('ERROR_CODE', 'Something went wrong');
tomLog.info('Application started');
Classes
- TomConsoleLogOutput
- Default console-based log output implementation.
- TomEnvironment
- Defines a runtime environment configuration.
- TomFallbackPlatformUtils
- A fallback implementation of TomPlatformUtils.
- TomLoggable
- Interface for objects that can provide a custom log representation.
- TomLogger
- The main logger class providing structured logging capabilities.
- TomLogLevel
- Represents a logging level with support for bitwise operations.
- TomLogOutput
- Abstract base class for log output implementations.
- TomPlatform
- Defines a target platform for bean selection.
- TomPlatformUtils
- Abstract base class for platform-specific utility operations.
- TomRuntime
- Central runtime configuration manager.
Constants
- defaultTomEnvironment → const TomEnvironment
- Default environment when none is specified.
- noTomEnvironment → const TomEnvironment
- Sentinel value indicating no environment constraint.
- noTomPlatform → const TomPlatform
- Sentinel value indicating no platform constraint.
- platformAndroid → const TomPlatform
- Android platform constant.
- platformFuchsia → const TomPlatform
- Fuchsia platform constant.
- platformIos → const TomPlatform
- iOS platform constant.
- platformLinux → const TomPlatform
- Linux platform constant.
- platformMacos → const TomPlatform
- macOS platform constant.
- platformWeb → const TomPlatform
- Web platform constant.
- platformWindows → const TomPlatform
- Windows platform constant.
Functions
Exceptions / Errors
- TomBaseException
- Base exception class with UUID tracking, timestamps, and stack trace support.