Changeset 54a0070 in mainline for uspace/srv/fs


Ignore:
Timestamp:
2012-09-10T09:54:09Z (14 years ago)
Author:
Vojtech Horky <vojtechhorky@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
40b5421
Parents:
1dbd189 (diff), 42bde6a (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge from lp:~vojtech-horky/helenos/logging

All logging is controlled by the logger service.

The API allows to create hierarchical logs and each log_msg()
must specify which log to use.

It is possible to change reported log level at runtime via
logset utility or at boot time through GRUB parameters.

Location:
uspace/srv/fs/udf
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/fs/udf/udf.c

    r1dbd189 r54a0070  
    6161int main(int argc, char *argv[])
    6262{
    63         log_init(NAME, LVL_NOTE);
    64         log_msg(LVL_NOTE, "HelenOS UDF 1.02 file system server");
     63        log_init(NAME);
     64        log_msg(LOG_DEFAULT, LVL_NOTE, "HelenOS UDF 1.02 file system server");
    6565       
    6666        if (argc == 3) {
     
    6868                        udf_vfs_info.instance = strtol(argv[2], NULL, 10);
    6969                else {
    70                         log_msg(LVL_FATAL, "Unrecognized parameters");
     70                        log_msg(LOG_DEFAULT, LVL_FATAL, "Unrecognized parameters");
    7171                        return 1;
    7272                }
     
    7676            service_connect_blocking(EXCHANGE_SERIALIZE, SERVICE_VFS, 0, 0);
    7777        if (!vfs_sess) {
    78                 log_msg(LVL_FATAL, "Failed to connect to VFS");
     78                log_msg(LOG_DEFAULT, LVL_FATAL, "Failed to connect to VFS");
    7979                return 2;
    8080        }
     
    8989                goto err;
    9090       
    91         log_msg(LVL_NOTE, "Accepting connections");
     91        log_msg(LOG_DEFAULT, LVL_NOTE, "Accepting connections");
    9292        task_retval(0);
    9393        async_manager();
     
    9797       
    9898err:
    99         log_msg(LVL_FATAL, "Failed to register file system (%d)", rc);
     99        log_msg(LOG_DEFAULT, LVL_FATAL, "Failed to register file system (%d)", rc);
    100100        return rc;
    101101}
  • uspace/srv/fs/udf/udf_file.c

    r1dbd189 r54a0070  
    7171            FLE32(exd->extent_location.lblock_num);
    7272       
    73         log_msg(LVL_DEBUG,
     73        log_msg(LOG_DEFAULT, LVL_DEBUG,
    7474            "Extended allocator: start=%d, block_num=%d, len=%d", start,
    7575            FLE32(exd->extent_location.lblock_num), FLE32(exd->info_length));
     
    100100        switch (icb_flag) {
    101101        case UDF_SHORT_AD:
    102                 log_msg(LVL_DEBUG,
     102                log_msg(LOG_DEFAULT, LVL_DEBUG,
    103103                    "ICB: sequence of allocation descriptors - icbflag = short_ad_t");
    104104               
     
    167167               
    168168        case UDF_LONG_AD:
    169                 log_msg(LVL_DEBUG,
     169                log_msg(LOG_DEFAULT, LVL_DEBUG,
    170170                    "ICB: sequence of allocation descriptors - icbflag = long_ad_t");
    171171               
     
    203203               
    204204        case UDF_EXTENDED_AD:
    205                 log_msg(LVL_DEBUG,
     205                log_msg(LOG_DEFAULT, LVL_DEBUG,
    206206                    "ICB: sequence of allocation descriptors - icbflag = extended_ad_t");
    207207                break;
    208208               
    209209        case UDF_DATA_AD:
    210                 log_msg(LVL_DEBUG,
     210                log_msg(LOG_DEFAULT, LVL_DEBUG,
    211211                    "ICB: sequence of allocation descriptors - icbflag = 3, node contains data itself");
    212212               
     
    253253                switch (FLE16(data->id)) {
    254254                case UDF_FILE_ENTRY:
    255                         log_msg(LVL_DEBUG, "ICB: File entry descriptor found");
     255                        log_msg(LOG_DEFAULT, LVL_DEBUG, "ICB: File entry descriptor found");
    256256                       
    257257                        udf_file_entry_descriptor_t *file =
     
    267267                       
    268268                case UDF_EFILE_ENTRY:
    269                         log_msg(LVL_DEBUG, "ICB: Extended file entry descriptor found");
     269                        log_msg(LOG_DEFAULT, LVL_DEBUG, "ICB: Extended file entry descriptor found");
    270270                       
    271271                        udf_extended_file_entry_descriptor_t *efile =
     
    281281                       
    282282                case UDF_ICB_TERMINAL:
    283                         log_msg(LVL_DEBUG, "ICB: Terminal entry descriptor found");
     283                        log_msg(LOG_DEFAULT, LVL_DEBUG, "ICB: Terminal entry descriptor found");
    284284                        block_put(block);
    285285                        return EOK;
  • uspace/srv/fs/udf/udf_ops.c

    r1dbd189 r54a0070  
    311311        rc = udf_volume_recongnition(service_id);
    312312        if (rc != EOK) {
    313                 log_msg(LVL_NOTE, "VRS failed");
     313                log_msg(LOG_DEFAULT, LVL_NOTE, "VRS failed");
    314314                fs_instance_destroy(service_id);
    315315                free(instance);
     
    322322        rc = udf_get_anchor_volume_descriptor(service_id, &avd);
    323323        if (rc != EOK) {
    324                 log_msg(LVL_NOTE, "Anchor read failed");
     324                log_msg(LOG_DEFAULT, LVL_NOTE, "Anchor read failed");
    325325                fs_instance_destroy(service_id);
    326326                free(instance);
     
    329329        }
    330330       
    331         log_msg(LVL_DEBUG,
     331        log_msg(LOG_DEFAULT, LVL_DEBUG,
    332332            "Volume: Anchor volume descriptor found. Sector size=%" PRIu32,
    333333            instance->sector_size);
    334         log_msg(LVL_DEBUG,
     334        log_msg(LOG_DEFAULT, LVL_DEBUG,
    335335            "Anchor: main sequence [length=%" PRIu32 " (bytes), start=%"
    336336            PRIu32 " (sector)]", avd.main_extent.length,
    337337            avd.main_extent.location);
    338         log_msg(LVL_DEBUG,
     338        log_msg(LOG_DEFAULT, LVL_DEBUG,
    339339            "Anchor: reserve sequence [length=%" PRIu32 " (bytes), start=%"
    340340            PRIu32 " (sector)]", avd.reserve_extent.length,
     
    353353        rc = udf_read_volume_descriptor_sequence(service_id, avd.main_extent);
    354354        if (rc != EOK) {
    355                 log_msg(LVL_NOTE, "Volume Descriptor Sequence read failed");
     355                log_msg(LOG_DEFAULT, LVL_NOTE, "Volume Descriptor Sequence read failed");
    356356                fs_instance_destroy(service_id);
    357357                free(instance);
     
    364364        rc = udf_node_get(&rfn, service_id, instance->volumes[DEFAULT_VOL].root_dir);
    365365        if (rc != EOK) {
    366                 log_msg(LVL_NOTE, "Can't create root node");
     366                log_msg(LOG_DEFAULT, LVL_NOTE, "Can't create root node");
    367367                fs_instance_destroy(service_id);
    368368                free(instance);
  • uspace/srv/fs/udf/udf_volume.c

    r1dbd189 r54a0070  
    6363fs_index_t udf_long_ad_to_pos(udf_instance_t *instance, udf_long_ad_t *long_ad)
    6464{
    65         log_msg(LVL_DEBUG, "Long_Ad to Pos: "
     65        log_msg(LOG_DEFAULT, LVL_DEBUG, "Long_Ad to Pos: "
    6666            "partition_num=%" PRIu16 ", partition_block=%" PRIu32,
    6767            FLE16(long_ad->location.partition_num),
     
    130130                    (str_lcmp(VRS_NSR3, (char *) vd->identifier, VRS_ID_LEN) == 0)) {
    131131                        nsr_found = true;
    132                         log_msg(LVL_DEBUG, "VRS: NSR found");
     132                        log_msg(LOG_DEFAULT, LVL_DEBUG, "VRS: NSR found");
    133133                        continue;
    134134                }
    135135               
    136136                if (str_lcmp(VRS_END, (char *) vd->identifier, VRS_ID_LEN) == 0) {
    137                         log_msg(LVL_DEBUG, "VRS: end found");
     137                        log_msg(LOG_DEFAULT, LVL_DEBUG, "VRS: end found");
    138138                        break;
    139139                }
     
    382382        switch (FLE16(desc->id)) {
    383383        case UDF_FILE_ENTRY:
    384                 log_msg(LVL_DEBUG, "ICB: File entry descriptor found");
     384                log_msg(LOG_DEFAULT, LVL_DEBUG, "ICB: File entry descriptor found");
    385385               
    386386                udf_file_entry_descriptor_t *fed =
     
    394394               
    395395        case UDF_EFILE_ENTRY:
    396                 log_msg(LVL_DEBUG, "ICB: Extended file entry descriptor found");
     396                log_msg(LOG_DEFAULT, LVL_DEBUG, "ICB: Extended file entry descriptor found");
    397397               
    398398                udf_extended_file_entry_descriptor_t *efed =
     
    514514                                    &instance->partitions[j];
    515515                               
    516                                 log_msg(LVL_DEBUG, "Volume[%" PRIun "]: partition [type %u] "
     516                                log_msg(LOG_DEFAULT, LVL_DEBUG, "Volume[%" PRIun "]: partition [type %u] "
    517517                                    "found and filled", i, pm1->partition_map_type);
    518518                               
     
    531531                                    (udf_metadata_partition_map_t *) idx;
    532532                               
    533                                 log_msg(LVL_DEBUG, "Metadata file location=%u",
     533                                log_msg(LOG_DEFAULT, LVL_DEBUG, "Metadata file location=%u",
    534534                                    FLE32(metadata->metadata_fileloc));
    535535                               
     
    569569                                    &instance->partitions[j];
    570570                               
    571                                 log_msg(LVL_DEBUG, "Virtual partition: num=%d, start=%d",
     571                                log_msg(LOG_DEFAULT, LVL_DEBUG, "Virtual partition: num=%d, start=%d",
    572572                                    instance->partitions[j].number,
    573573                                    instance->partitions[j].start);
    574                                 log_msg(LVL_DEBUG, "Volume[%" PRIun "]: partition [type %u] "
     574                                log_msg(LOG_DEFAULT, LVL_DEBUG, "Volume[%" PRIun "]: partition [type %u] "
    575575                                    "found and filled", i, pm2->partition_map_type);
    576576                               
     
    583583                        udf_general_type_t *pm = (udf_general_type_t *) idx;
    584584                       
    585                         log_msg(LVL_DEBUG, "Volume[%" PRIun "]: partition [type %u] "
     585                        log_msg(LOG_DEFAULT, LVL_DEBUG, "Volume[%" PRIun "]: partition [type %u] "
    586586                            "found and skipped", i, pm->partition_map_type);
    587587                       
     
    657657                /* One sector size descriptors */
    658658                case UDF_TAG_PVD:
    659                         log_msg(LVL_DEBUG, "Volume: Primary volume descriptor found");
     659                        log_msg(LOG_DEFAULT, LVL_DEBUG, "Volume: Primary volume descriptor found");
    660660                       
    661661                        if (!udf_check_prevailing_pvd(pvd, pvd_cnt, &vol->volume)) {
     
    669669                       
    670670                case UDF_TAG_VDP:
    671                         log_msg(LVL_DEBUG, "Volume: Volume descriptor pointer found");
     671                        log_msg(LOG_DEFAULT, LVL_DEBUG, "Volume: Volume descriptor pointer found");
    672672                        pos++;
    673673                        break;
    674674                       
    675675                case UDF_TAG_IUVD:
    676                         log_msg(LVL_DEBUG,
     676                        log_msg(LOG_DEFAULT, LVL_DEBUG,
    677677                            "Volume: Implementation use volume descriptor found");
    678678                        pos++;
     
    680680                       
    681681                case UDF_TAG_PD:
    682                         log_msg(LVL_DEBUG, "Volume: Partition descriptor found");
    683                         log_msg(LVL_DEBUG, "Partition number: %u, contents: '%.6s', "
     682                        log_msg(LOG_DEFAULT, LVL_DEBUG, "Volume: Partition descriptor found");
     683                        log_msg(LOG_DEFAULT, LVL_DEBUG, "Partition number: %u, contents: '%.6s', "
    684684                            "access type: %" PRIu32, FLE16(vol->partition.number),
    685685                            vol->partition.contents.id, FLE32(vol->partition.access_type));
    686                         log_msg(LVL_DEBUG, "Partition start: %" PRIu32 " (sector), "
     686                        log_msg(LOG_DEFAULT, LVL_DEBUG, "Partition start: %" PRIu32 " (sector), "
    687687                            "size: %" PRIu32 " (sectors)",
    688688                            FLE32(vol->partition.starting_location),
     
    698698                            (udf_partition_header_descriptor_t *) vol->partition.contents_use;
    699699                        if (FLE32(phd->unallocated_space_table.length)) {
    700                                 log_msg(LVL_DEBUG,
     700                                log_msg(LOG_DEFAULT, LVL_DEBUG,
    701701                                    "space table: length=%" PRIu32 ", pos=%" PRIu32,
    702702                                    FLE32(phd->unallocated_space_table.length),
     
    712712                       
    713713                        if (FLE32(phd->unallocated_space_bitmap.length)) {
    714                                 log_msg(LVL_DEBUG,
     714                                log_msg(LOG_DEFAULT, LVL_DEBUG,
    715715                                    "space bitmap: length=%" PRIu32 ", pos=%" PRIu32,
    716716                                    FLE32(phd->unallocated_space_bitmap.length),
     
    730730                /* Relative size descriptors */
    731731                case UDF_TAG_LVD:
    732                         log_msg(LVL_DEBUG, "Volume: Logical volume descriptor found");
     732                        log_msg(LOG_DEFAULT, LVL_DEBUG, "Volume: Logical volume descriptor found");
    733733                       
    734734                        aoff64_t sct =
     
    743743                            &vol->logical.charset);
    744744                       
    745                         log_msg(LVL_DEBUG, "Logical Volume ID: '%s', "
     745                        log_msg(LOG_DEFAULT, LVL_DEBUG, "Logical Volume ID: '%s', "
    746746                            "logical block size: %" PRIu32 " (bytes)", tmp,
    747747                            FLE32(vol->logical.logical_block_size));
    748                         log_msg(LVL_DEBUG, "Map table size: %" PRIu32 " (bytes), "
     748                        log_msg(LOG_DEFAULT, LVL_DEBUG, "Map table size: %" PRIu32 " (bytes), "
    749749                            "number of partition maps: %" PRIu32,
    750750                            FLE32(vol->logical.map_table_length),
     
    761761                       
    762762                case UDF_TAG_USD:
    763                         log_msg(LVL_DEBUG, "Volume: Unallocated space descriptor found");
     763                        log_msg(LOG_DEFAULT, LVL_DEBUG, "Volume: Unallocated space descriptor found");
    764764                       
    765765                        sct = ALL_UP((sizeof(udf_unallocated_space_descriptor_t) +
     
    780780                       
    781781                case UDF_TAG_LVID:
    782                         log_msg(LVL_DEBUG,
     782                        log_msg(LOG_DEFAULT, LVL_DEBUG,
    783783                            "Volume: Logical volume integrity descriptor found");
    784784                       
     
    787787                       
    788788                case UDF_TAG_TD:
    789                         log_msg(LVL_DEBUG, "Volume: Terminating descriptor found");
     789                        log_msg(LOG_DEFAULT, LVL_DEBUG, "Volume: Terminating descriptor found");
    790790                       
    791791                        /* Found terminating descriptor. Exiting */
     
    823823                udf_descriptor_tag_t *desc = block->data;
    824824               
    825                 log_msg(LVL_DEBUG, "First tag ID=%" PRIu16, desc->id);
     825                log_msg(LOG_DEFAULT, LVL_DEBUG, "First tag ID=%" PRIu16, desc->id);
    826826               
    827827                if (desc->checksum != udf_tag_checksum((uint8_t *) desc)) {
Note: See TracChangeset for help on using the changeset viewer.