-
-
Notifications
You must be signed in to change notification settings - Fork 64
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Not printing header/data #217
Comments
If you added a TalkerDioLogger to dio interceptor, check to passed a talker instance in the 'talker' parameter. |
static talkerInit() {
final talker = TalkerFlutter.init(
settings: TalkerSettings(
colors: {
TalkerLogType.verbose: AnsiPen()..yellow(),
},
),
);
DI.registerSingleton<Talker>(talker);
talker.verbose('Talker initialization completed');
}
post(
String path, {
dynamic data,
Map<String, dynamic>? queryParameters,
Options? options,
bool isRaw = false,
bool isShowLoading = false,
String? loadingText = "Loading",
VFMAnimationType? loadingAnimation = VFMAnimationType.circular,
String? lottieLoadingAsset = "",
bool isShowResultDialog = false,
String? message,
bool printResponseData = false,
bool printResponseHeaders = false,
bool printRequestData = true,
bool printRequestHeaders = true,
}) async {
dio.interceptors.clear();
dio.interceptors.add(customInterceptors(
isShowLoading, loadingText!, loadingAnimation!, lottieLoadingAsset!));
dio.interceptors.add(customTalker(
printResponseHeaders: printRequestHeaders,
printRequestHeaders: printRequestHeaders,
printRequestData: printRequestData,
printResponseData: printResponseData,
));
dio.options.baseUrl = isRaw ? path : baseUrl;
Options requestOptions = options ?? Options();
requestOptions.headers = requestOptions.headers ?? {};
Map<String, dynamic>? authorization = getAuthorizationHeader();
if (authorization != null) {
requestOptions.headers!.addAll(authorization);
}
var response = await dio.post(
path,
data: data,
queryParameters: queryParameters,
options: requestOptions,
cancelToken: cancelToken,
);
dio.options.baseUrl = baseUrl;
return response.data;
}
TalkerDioLogger customTalker({
bool printResponseData = false,
bool printResponseHeaders = false,
bool printRequestData = true,
bool printRequestHeaders = true,
}) =>
TalkerDioLogger(
talker: DI.get<Talker>(),
settings: TalkerDioLoggerSettings(
printResponseData: printResponseData,
printResponseHeaders: printResponseHeaders,
printRequestData: printRequestData,
printRequestHeaders: printRequestHeaders,
),
); as you can see I added a talker instance, this issue only happens when form data is being pass, it works if normal json data is being pass @silvershort |
Hello @satishs22 ! Right now talker_dio_logger can't printout FormData to console. |
Describe the bug
The log is not printing header or data when form data is being passed.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Suppose be printing header/form data
Screenshots
If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
Smartphone (please complete the following information):
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: