lc_utils library
A collection of useful dart functions and classes.
Classes
- Breadcrumb
-
Structured data to describe more information prior to the event captured.
See
Sentry.captureEvent()
. - CachingExceptionTypeIdentifier
- Contexts
- The context interfaces provide additional context data.
- CsvCodec
- See CsvToListConverter and ListToCsvConverter.
- CsvToListConverter
- A Csv converter that returns the individual rows as lists of values.
- CsvToListSink
- The input sink for a chunked csv-string to list conversion.
- CSVUtil
- CustomSentryMeasurementUnit
- Custom units without builtin conversion. No formatting will be applied to the measurement value in the Sentry product, and the value with the unit will be shown as is.
- DateUtil
- Debouncer
- DebugImage
- The list of debug images contains all dynamic libraries loaded into the process and their memory addresses. Instruction addresses in the Stack Trace are mapped into the list of debug images in order to retrieve debug files for symbolication. There are two kinds of debug images: Native debug images with types macho, elf, and pe Android debug images with type proguard more details : https://develop.sentry.dev/sdk/event-payloads/debugmeta/
- DebugMeta
- The debug meta interface carries debug information for processing errors and crash reports.
- Dsn
- The Data Source Name (DSN) tells the SDK where to send the events
- EventProcessor
- EventProcessors are callbacks that run for every event. They can either return a new event which in most cases means just adding data or return null in case the event will be dropped and not sent.
- ExceptionCause
- Holds inner exception and stackTrace combinations contained in other exceptions
-
ExceptionCauseExtractor<
T> - Extend this abstract class and return inner ExceptionCause of your exceptions.
-
ExceptionStackTraceExtractor<
T> - Sentry handles Error.stackTrace by default. For other cases extend this abstract class and return a custom StackTrace of your exceptions.
- ExceptionTypeIdentifier
- An abstract class for identifying the type of Dart errors and exceptions.
- ExitCode
- FileType
- 文件读写工具类
- GitUtil
- Hint
- Hints are used in BeforeSendCallback, BeforeBreadcrumbCallback and event processors.
- Hub
- SDK API contract which combines a client and scope management
- HubAdapter
- Hub adapter to make Integrations testable
-
Integration<
T extends SentryOptions> - Code that provides middlewares, bindings or hooks into certain frameworks or environments, along with code that inserts those bindings and activates them.
- IOUtil
- ISentrySpan
- Represents performance monitoring Span.
- IsolateErrorIntegration
- NoOp web integration : isolate doesnt' work in browser
- List2CsvSink
- The input sink for a chunked list to csv conversion.
- ListToCsvConverter
- Converts rows -- a List of Lists into a csv String.
- Logger
- LogicalCalculation
- dart中逻辑计算类-只涉及简单加减乘除
- MapUtil
- Mechanism
- Sentry Exception Mechanism The exception mechanism is an optional field residing in the Exception Interface. It carries additional information about the way the exception was created on the target system. This includes general exception values obtained from operating system or runtime APIs, as well as mechanism-specific values.
- NoneSentryMeasurementUnit
- Untyped value.
- NoOpSentrySpan
-
Nullable<
T> - NumberUtil
- PathUtil
- PerformanceCollector
- PerformanceContinuousCollector
- Used for collecting continuous data about vitals (slow, frozen frames, etc.) during a transaction/span.
- PlatformChecker
- Helper to check in which environment the library is running. The environment checks (release/debug/profile) are mutually exclusive.
- PlatformName
- 非Web模式下判断
- PlatformUtil
- ProcessRunner
- 工具库 - 进程交互相关
- ProcessUtil
- RunZonedGuardedIntegration
-
Integration that runs runner function within
runZonedGuarded
and capture errors on therunZonedGuarded
error handler. See https://api.dart.dev/stable/dart-async/runZonedGuarded.html - Scope
- Scope data to be sent with the event
- ScopeObserver
- SdkInfo
- An object describing the system SDK.
- SdkVersion
- Describes the SDK that is submitting events to Sentry.
- Sentry
- Sentry SDK main entry point
- SentryApp
- App context describes the application.
- SentryAttachment
- Arbitrary content which gets attached to an event.
- SentryBaggage
- SentryBaggageHeader
- SentryBrowser
- Carries information about the browser or user agent for web-related errors.
- SentryClient
- Logs crash reports and events to the Sentry.io service.
- SentryCulture
- Culture Context describes certain properties of the culture in which the software is used.
- SentryDevice
- This describes the device that caused the event.
- SentryEnvelope
-
Class representation of
Envelope
file. - SentryEnvelopeItem
- Item holding header information and JSON encoded data.
- SentryEvent
- An event to be reported to Sentry.io.
- SentryException
- The Exception Interface specifies an exception or error that occurred in a program.
- SentryFeedback
- SentryGeo
- Geographical location of the end user or device.
- SentryGpu
- GPU context describes the GPU of the device.
- SentryHttpClient
- A http-package compatible HTTP client.
- SentryId
- Hexadecimal string representing a uuid4 value. The length is exactly 32 characters. Dashes are not allowed. Has to be lowercase.
- SentryLevel
- Severity of the logged Event.
- SentryLoggerCategory
- 日志上报分类
- SentryMeasurement
- SentryMeasurementUnit
- The unit of measurement of a metric value. Units augment metric values by giving them a magnitude and semantics. Units and their precisions are uniquely represented by a string identifier.
- SentryMessage
- The Message Interface carries a log message that describes an event or error. Optionally, it can carry a format string and structured parameters. This can help to group similar messages into the same issue. example of a serialized message:
- SentryOperatingSystem
- Describes the operating system on which the event was created.
- SentryOptions
- Sentry SDK options
- SentryPackage
- A SentryPackage part of the SDK.
- SentryProxy
- SentryRequest
- The Request interface contains information on a HTTP request related to the event. In client SDKs, this can be an outgoing request, or the request that rendered the current web page. On server SDKs, this could be the incoming web request that is being handled.
- SentryResponse
- The response interface contains information on a HTTP request related to the event.
- SentryRuntime
- Describes a runtime in more detail.
- SentrySamplingContext
- Context used by TracesSamplerCallback to determine if transaction is going to be sampled.
- SentrySpan
- SentrySpanContext
- SentryStackFrame
- Frames belong to a StackTrace It should contain at least a filename, function or instruction_addr
- SentryStackTrace
- Stacktrace holds information about the frames of the stack.
- SentryStatusCode
- SentryThread
- The Threads Interface specifies threads that were running at the time an event happened. These threads can also contain stack traces. See https://develop.sentry.dev/sdk/event-payloads/threads/
- SentryTraceContext
- SentryTraceContextHeader
- SentryTraceHeader
- Represents HTTP header "sentry-trace".
- SentryTracesSamplingDecision
- SentryTransaction
- SentryTransactionContext
- SentryTransactionInfo
- SentryUser
- Describes the current user associated with the application, such as the currently signed in user.
- SentryUserFeedback
- SentryUtil
- 公共日志上传工具
- SentryViewHierarchy
- SentryViewHierarchyElement
- SpanDataConvention
- SpanId
- The length is exactly 16 characters. Dashes are not allowed. Has to be lowercase.
- SpanStatus
- The Span statuses
- Spotlight
- Spotlight configuration class.
- TextUtil
- TextUtilVersion
- 版本号文本处理函数
- Throttler
- Transport
- A transport is in charge of sending the event/envelope either via http or caching in the disk.
- TypeCheckHint
- Constants used for Type Check hints.
- UnsupportedThrowablesHandler
- A handler for unsupported throwables used for Expando
- ValidatorUtilBool
- ValidatorUtilString
Enums
- DurationSentryMeasurementUnit
- EmptyValue
- FillTextAlign
- FractionSentryMeasurementUnit
- InformationSentryMeasurementUnit
- LoggerLevel
- Dart日志输出相关等级
- MaxRequestBodySize
- Describes the size of http request bodies which should be added to an event
- MaxResponseBodySize
- Describes the size of http response bodies which should be added to an event This enum might be removed at any time.
- SentryOrientation
- If a device is on portrait or landscape mode
- SentryProxyType
- SentryTransactionNameSource
Mixins
-
SentryEventLike<
T> - A SentryEventLike mixin that is extended by SentryEvent and SentryTransaction
Extensions
- CacheableExceptionIdentifier on ExceptionTypeIdentifier
- DateTimeExtension on DateTime
- 时间拓展方法
- MaxRequestBodySizeX on MaxRequestBodySize
- MaxResponseBodySizeX on MaxResponseBodySize
- NullableExtBool on bool
- NullableExtBoolN on bool?
- NullableExtDateTime on DateTime
- NullableExtDateTimeN on DateTime?
- NullableExtDouble on double
- NullableExtDoubleN on double?
- NullableExtInt on int
- NullableExtIntN on int?
-
NullableExtIterable
on Iterable<
T> -
NullableExtIterableN
on Iterable<
T> ? -
NullableExtList
on List<
T> -
NullableExtListN
on List<
T> ? -
NullableExtMap
on Map<
K, V> -
NullableExtMapN
on Map<
K, V> ? -
NullableExtSet
on Set<
T> -
NullableExtSetN
on Set<
T> ? - NullableExtString on String
- NullableExtStringN on String?
- SentryMeasurementUnitExtension on SentryMeasurementUnit
Constants
- defaultDelimitAllFields → const bool
- defaultEol → const String
- The RFC conform default value for eol.
- defaultFieldDelimiter → const String
- The RFC conform default value for field delimiter.
- defaultTextDelimiter → const String
- The RFC conform default value for the text delimiter.
Properties
- defaultIpAddress → String
-
no setter
- isDev → bool
-
判断是否处理开发模式
no setter
Functions
-
addBaggageHeader(
SentryBaggageHeader baggage, Map< String, dynamic> headers, {SentryLogger? logger}) → void -
addBaggageHeaderFromSpan(
ISentrySpan span, Map< String, dynamic> headers, {SentryLogger? logger}) → void -
addSentryTraceHeader(
SentryTraceHeader traceHeader, Map< String, dynamic> headers) → void -
addSentryTraceHeaderFromSpan(
ISentrySpan span, Map< String, dynamic> headers) → void -
containsTargetOrMatchesRegExp(
List< String> tracePropagationTargets, String url) → bool -
dartLogger(
SentryLevel level, String message, {String? logger, Object? exception, StackTrace? stackTrace}) → void - A Logger that prints out the level and message
-
getFileSizeText(
num size) → String - 获取文件大小文本,当取余结果为0时,不显示小数点后面的值
-
isValidSampleRand(
double? sampleRand) → bool -
isValidSampleRate(
double? sampleRate) → bool -
noOpLogger(
SentryLevel level, String message, {String? logger, Object? exception, StackTrace? stackTrace}) → void - A NoOp logger that does nothing
Typedefs
-
AppRunner
= FutureOr<
void> Function() -
Runs a callback inside of the
runZonedGuarded
method, useful for running yourrunApp(MyApp())
- BeforeBreadcrumbCallback = Breadcrumb? Function(Breadcrumb? breadcrumb, Hint hint)
- This function is called with an SDK specific breadcrumb object before the breadcrumb is added to the scope. When nothing is returned from the function, the breadcrumb is dropped
- BeforeCallback = Breadcrumb Function(dynamic error, dynamic stackTrace)
-
BeforeMetricCallback
= bool Function(String key, {Map<
String, String> ? tags}) - This function is called right before a metric is about to be emitted. Can return true to emit the metric, or false to drop it.
-
BeforeSendCallback
= FutureOr<
SentryEvent?> Function(SentryEvent event, Hint hint) - This function is called with an SDK specific event object and can return a modified event object or nothing to skip reporting the event
-
BeforeSendTransactionCallback
= FutureOr<
SentryTransaction?> Function(SentryTransaction transaction) - This function is called with an SDK specific transaction object and can return a modified transaction object or nothing to skip reporting the transaction
- ClockProvider = DateTime Function()
- Used to provide timestamp for logging.
-
ContentLoader
= FutureOr<
Uint8List> Function() - FieldValueParser = dynamic Function(String key, dynamic value)
-
OnFinishedCallback
= Future<
void> Function({DateTime? endTimestamp}) -
OnTransactionFinish
= FutureOr<
void> Function(ISentrySpan transaction) - Called when a transaction is finished.
-
OptionsConfiguration
= FutureOr<
void> Function(SentryOptions) - Configuration options callback
- ReportCallback = void Function(String errorMsg)
-
RunZonedGuardedOnError
= FutureOr<
void> Function(Object, StackTrace) -
Caught exception and stacktrace in
runZonedGuarded
-
RunZonedGuardedRunner
= Future<
void> Function() -
Called inside of
runZonedGuarded
-
ScopeCallback
= FutureOr<
void> Function(Scope) - Configures the scope through the callback.
- SentryLogger = void Function(SentryLevel level, String message, {Object? exception, String? logger, StackTrace? stackTrace})
- Logger interface to log useful debugging information if debug is enabled
- StringCallback = String? Function()
- 带有校验结果的校验放
- TracesSamplerCallback = double? Function(SentrySamplingContext samplingContext)
- ValidatorFn = String? Function(String? val, {String? tipText})
- 校验函数
-
ValueChanged<
T> = void Function(T value) - VoidCallback = void Function()
Exceptions / Errors
- FileIOException
- InvalidSentryTraceHeaderException
- SentryHttpClientError
- ThrowableMechanism
- A decorator that holds a Mechanism related to the decorated Exception