The dbg_log API is DISCARDED. Change all dbg_log to LOG_X.

This commit is contained in:
armink
2018-11-02 10:20:30 +08:00
parent 5a70247898
commit 83b7b763b7
17 changed files with 309 additions and 312 deletions
+1 -1
View File
@@ -185,7 +185,7 @@ int fd_new(void)
if (idx == fdt->maxfd)
{
idx = -(1 + DFS_FD_OFFSET);
dbg_log(DBG_ERROR, "DFS fd new is failed! Could not found an empty fd entry.");
LOG_E( "DFS fd new is failed! Could not found an empty fd entry.");
goto __result;
}
+9 -9
View File
@@ -46,7 +46,7 @@ int dfs_file_open(struct dfs_fd *fd, const char *path, int flags)
return -ENOMEM;
}
dbg_log(DBG_LOG, "open file:%s\n", fullpath);
LOG_D("open file:%s", fullpath);
/* Check whether file is already open */
if (fd_is_open(fullpath) == 0)
@@ -65,7 +65,7 @@ int dfs_file_open(struct dfs_fd *fd, const char *path, int flags)
return -ENOENT;
}
dbg_log(DBG_LOG, "open in filesystem:%s\n", fs->ops->name);
LOG_D("open in filesystem:%s", fs->ops->name);
fd->fops = fs->ops->fops; /* set file ops */
/* initialize the fd item */
@@ -82,7 +82,7 @@ int dfs_file_open(struct dfs_fd *fd, const char *path, int flags)
else
fd->path = rt_strdup(dfs_subdir(fs->path, fullpath));
rt_free(fullpath);
dbg_log(DBG_LOG, "Actual file path: %s\n", fd->path);
LOG_D("Actual file path: %s", fd->path);
}
else
{
@@ -105,7 +105,7 @@ int dfs_file_open(struct dfs_fd *fd, const char *path, int flags)
rt_free(fd->path);
fd->path = NULL;
dbg_log(DBG_ERROR, "open failed\n");
LOG_E("open failed");
return result;
}
@@ -117,7 +117,7 @@ int dfs_file_open(struct dfs_fd *fd, const char *path, int flags)
fd->flags |= DFS_F_DIRECTORY;
}
dbg_log(DBG_INFO, "open successful\n");
LOG_I("open successful");
return 0;
}
@@ -375,8 +375,8 @@ int dfs_file_stat(const char *path, struct stat *buf)
if ((fs = dfs_filesystem_lookup(fullpath)) == NULL)
{
dbg_log(DBG_ERROR,
"can't find mounted filesystem on this path:%s\n", fullpath);
LOG_E(
"can't find mounted filesystem on this path:%s", fullpath);
rt_free(fullpath);
return -ENOENT;
@@ -405,8 +405,8 @@ int dfs_file_stat(const char *path, struct stat *buf)
if (fs->ops->stat == NULL)
{
rt_free(fullpath);
dbg_log(DBG_ERROR,
"the filesystem didn't implement this function\n");
LOG_E(
"the filesystem didn't implement this function");
return -ENOSYS;
}
+5 -5
View File
@@ -55,7 +55,7 @@ int dfs_register(const struct dfs_filesystem_ops *ops)
if (empty == NULL)
{
rt_set_errno(-ENOSPC);
dbg_log(DBG_ERROR, "There is no space to register this file system (%d).\n", ops->name);
LOG_E("There is no space to register this file system (%d).", ops->name);
ret = -1;
}
else if (ret == RT_EOK)
@@ -304,7 +304,7 @@ int dfs_mount(const char *device_name,
if ((fs == NULL) && (iter == &filesystem_table[DFS_FILESYSTEMS_MAX]))
{
rt_set_errno(-ENOSPC);
dbg_log(DBG_ERROR, "There is no space to mount this file system (%s).\n", filesystemtype);
LOG_E("There is no space to mount this file system (%s).", filesystemtype);
goto err1;
}
@@ -437,7 +437,7 @@ int dfs_mkfs(const char *fs_name, const char *device_name)
if (dev_id == NULL)
{
rt_set_errno(-ENODEV);
dbg_log(DBG_ERROR, "Device (%s) was not found\n", device_name);
LOG_E("Device (%s) was not found", device_name);
return -1;
}
@@ -458,7 +458,7 @@ int dfs_mkfs(const char *fs_name, const char *device_name)
const struct dfs_filesystem_ops *ops = filesystem_operation_table[index];
if (ops->mkfs == NULL)
{
dbg_log(DBG_ERROR, "The file system (%s) mkfs function was not implement\n", fs_name);
LOG_E("The file system (%s) mkfs function was not implement", fs_name);
rt_set_errno(-ENOSYS);
return -1;
}
@@ -466,7 +466,7 @@ int dfs_mkfs(const char *fs_name, const char *device_name)
return ops->mkfs(dev_id);
}
dbg_log(DBG_ERROR, "File system (%s) was not found.\n", fs_name);
LOG_E("File system (%s) was not found.", fs_name);
return -1;
}
+5 -5
View File
@@ -70,19 +70,19 @@ static int serial_fops_open(struct dfs_fd *fd)
switch (fd->flags & O_ACCMODE)
{
case O_RDONLY:
dbg_log(DBG_LOG, "fops open: O_RDONLY!\n");
LOG_D("fops open: O_RDONLY!");
flags = RT_DEVICE_FLAG_INT_RX | RT_DEVICE_FLAG_RDONLY;
break;
case O_WRONLY:
dbg_log(DBG_LOG, "fops open: O_WRONLY!\n");
LOG_D("fops open: O_WRONLY!");
flags = RT_DEVICE_FLAG_WRONLY;
break;
case O_RDWR:
dbg_log(DBG_LOG, "fops open: O_RDWR!\n");
LOG_D("fops open: O_RDWR!");
flags = RT_DEVICE_FLAG_INT_RX | RT_DEVICE_FLAG_RDWR;
break;
default:
dbg_log(DBG_ERROR, "fops open: unknown mode - %d!\n", fd->flags & O_ACCMODE);
LOG_E("fops open: unknown mode - %d!", fd->flags & O_ACCMODE);
break;
}
@@ -559,7 +559,7 @@ static rt_err_t rt_serial_open(struct rt_device *dev, rt_uint16_t oflag)
RT_ASSERT(dev != RT_NULL);
serial = (struct rt_serial_device *)dev;
dbg_log(DBG_LOG, "open serial device: 0x%08x with open flag: 0x%04x\n",
LOG_D("open serial device: 0x%08x with open flag: 0x%04x",
dev, oflag);
/* check device flag with the open flag */
if ((oflag & RT_DEVICE_FLAG_DMA_RX) && !(dev->flag & RT_DEVICE_FLAG_DMA_RX))