Logging module for S3 accessor library.
Provides configurable logging with multiple severity levels to help diagnose issues and understand library behavior.
use s3_logger
! Set log level (default is ERROR)
call s3_set_log_level(S3_LOG_LEVEL_DEBUG)
! Log messages at different levels
call s3_log_error('Failed to download object')
call s3_log_warn('Retrying connection')
call s3_log_info('Initialized S3 connection')
call s3_log_debug('Built URL: https://...')
call s3_log_trace('curl command: curl -s ...')
Log level can be set via environment variable S3_LOG_LEVEL
:
export S3_LOG_LEVEL=DEBUG
./my_program
Valid values: NONE, ERROR, WARN, INFO, DEBUG, TRACE (case-insensitive)
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
integer, | public, | parameter | :: | S3_LOG_LEVEL_NONE | = | 0 | |
integer, | public, | parameter | :: | S3_LOG_LEVEL_ERROR | = | 1 | |
integer, | public, | parameter | :: | S3_LOG_LEVEL_WARN | = | 2 | |
integer, | public, | parameter | :: | S3_LOG_LEVEL_INFO | = | 3 | |
integer, | public, | parameter | :: | S3_LOG_LEVEL_DEBUG | = | 4 | |
integer, | public, | parameter | :: | S3_LOG_LEVEL_TRACE | = | 5 | |
integer, | private, | save | :: | current_log_level | = | S3_LOG_LEVEL_ERROR |
Set the current log level.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | level |
Log an error message.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=*), | intent(in) | :: | message |
Log a warning message.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=*), | intent(in) | :: | message |
Log an informational message.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=*), | intent(in) | :: | message |
Log a debug message.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=*), | intent(in) | :: | message |
Log a trace message (very detailed).
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=*), | intent(in) | :: | message |
Parse log level from string.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=*), | intent(in) | :: | level_str | |||
integer, | intent(out) | :: | level |