Logger class
설명
- 릴리즈 모드일때 터미널 출력 로직은 실행되지 않는다.
- 로그 형식은 LoggerCore 클래스가 제공하는 형식을 그대로 따른다.
- warning, error,
fatal 함수의 경우, 호출스택을 표시하는 것이 기본이며, 변경 가능하다.
- error,
fatal 함수의 경우, UI 상 경고창을 띄우는 것이 기본이며, 변경 가능하다.
사용 방법
- 로그 함수 호출 전,
Logger.init 함수를 호출하여 로깅 시스템을 초기화한다. (추후 수정될 예정)
- test, info, warning, error,
fatal 함수들 중, 상황에 맞는 로깅 함수를 호출한다.
사용 예시
Logger.info(
'User logined.',
title: 'Auth',
category: 'auth',
);
try {
...
}
catch (e, s) {
Logger.error(
'Login has been failed.',
title: 'Auth',
category: 'auth',
exception: e,
stackTrace: s,
);
}
Properties
-
hashCode
→ int
-
The hash code for this object.
no setterinherited
-
runtimeType
→ Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(Invocation invocation)
→ dynamic
-
Invoked when a nonexistent method or property is accessed.
inherited
-
toString()
→ String
-
A string representation of this object.
inherited
Static Methods
-
error({String? content, String? title, String? category, Object? exception, StackTrace? stackTrace, int maxStackTraceLine = 20, bool hideStackTrace = false})
→ void
-
설명
-
info({String? content, String? title, String? category, Object? exception, StackTrace? stackTrace, int maxStackTraceLine = 20, bool hideStackTrace = true})
→ void
-
설명
-
test({String? content, Object? exception, StackTrace? stackTrace, int maxStackTraceLine = 20, bool hideStackTrace = true})
→ void
-
설명
-
warning({String? content, String? title, String? category, Object? exception, StackTrace? stackTrace, int maxStackTraceLine = 20, bool hideStackTrace = false})
→ void
-
설명