Examples
- Basic Logging
- Error Handling
- Development Debugging
Debug vs Release Mode
NeoLogger automatically adjusts its logging behavior based on whether your app is running in debug or release mode:Debug Mode (
flutter run, development builds):- Shows every log level:
trace,debug,info,warning,error,fatal
flutter build, production builds):- Shows only:
info,warning,error,fatal - Filters out
traceanddebuglogs
trace and debug calls throughout your codebase during development - they won’t clutter the user experience in production builds.
Methods
NeoLogger.trace()
Logs detailed execution flow information, typically used for fine-grained debugging. Great for tracing your code.Parameters
String
required
The trace message to log.
NeoLogger.debug()
Logs debugging information useful during development and troubleshooting.Parameters
String
required
The debug message to log.
NeoLogger.info()
Logs general informational messages about application flow and events.Parameters
String
required
The informational message to log.
NeoLogger.warning()
Logs warning messages for potentially problematic situations that don’t prevent execution.Parameters
String
required
The warning message to log.
NeoLogger.error()
Logs error messages with exception details and optional stack traces.Required Parameters
String
required
The error message describing what went wrong.
dynamic
required
The error or exception object that was caught.
Optional Parameters
StackTrace
The stack trace associated with the error for debugging purposes.
NeoLogger.fatal()
Logs critical error messages that typically indicate application-breaking issues.Required Parameters
String
required
The fatal error message describing the critical issue.
dynamic
required
The error or exception object that caused the fatal condition.
Optional Parameters
StackTrace
The stack trace associated with the fatal error.
Best Practices
- Do not log passwords, tokens, or other secrets.
- Use
traceanddebugfor development. Release builds omit them. - Use
infofor events you still want in a release build.

