SemiLogger class
The logger is static in app. That mean is the logger config will be apply on all logger object on your app. Use instance for custom a special logger.
Constructors
- SemiLogger({String? name = 'semi-log', bool? debugMode = true, String? lineChar = '=', int? lineLength = 50})
-
When your want to define a special logger,
it will not change when re-setup logger
factory
- SemiLogger.setup({String name = 'semi-log', bool debugMode = true, SemiLogStyleData styleData = const SemiLogStyleData(), String lineChar = '=', int lineLength = 50})
-
Define your logger,
it will be overrides all next logger print
factory
Properties
- debugMode → bool
-
Some log only print on debugMode
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- name → String
-
The logger name, text will appear on log header
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- separatorChar → String
-
The char will be fill in line separator
final
- separatorLength → int
-
The number char in line separator
final
- styleData → SemiLogStyleData
-
Your styles of logger
final
Methods
-
block(
List< SemiLogLevelData> messages, {String? linePrefix, bool lineNumber = false, bool headerSeparator = false}) → void - print the multi line message
-
breakLine(
) → void - print empty line
-
custom(
List< SemiLogContent> contents, {String separator = ' ', dynamic hasHeader = true}) → void - print a line with custom
-
d(
String message) → void - print the message in debug level
-
e(
String message) → void - print the message in error level
-
fail(
String message) → void - print the message in fail level
-
i(
String message) → void - print the message in info level
-
log(
{SemiLogLevel level = SemiLogLevel.debug, required String message, bool hasHeader = true}) → void - print the message with level format in debugMode except error, warning and info
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
print(
dynamic object) → void - print your object without format doesn't depend on debugMode
-
separator(
[String message = '', bool hasHeader = false]) → void - print the start line
-
success(
String message) → void - print the message in success level
-
toString(
) → String -
A string representation of this object.
inherited
-
w(
String message) → void - print the message in warning level
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Properties
- instance → SemiLogger
-
no setter