summaryrefslogtreecommitdiff
path: root/components
diff options
context:
space:
mode:
authorarmink <[email protected]>2018-11-02 10:14:08 +0800
committerarmink <[email protected]>2018-11-02 10:20:30 +0800
commit83b7b763b7b40f53f4fcb39483fc6e387d5d4632 (patch)
tree84eeee8a21ca14c85398f1c6d8a632b4c046f617 /components
parent5a70247898dc681534c75d88fd3f188a63888080 (diff)
The dbg_log API is DISCARDED. Change all dbg_log to LOG_X.
Diffstat (limited to 'components')
-rw-r--r--components/dfs/src/dfs.c2
-rw-r--r--components/dfs/src/dfs_file.c18
-rw-r--r--components/dfs/src/dfs_fs.c10
-rw-r--r--components/drivers/serial/serial.c10
4 files changed, 20 insertions, 20 deletions
diff --git a/components/dfs/src/dfs.c b/components/dfs/src/dfs.c
index d8cd09baa2..38a1813421 100644
--- a/components/dfs/src/dfs.c
+++ b/components/dfs/src/dfs.c
@@ -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;
}
diff --git a/components/dfs/src/dfs_file.c b/components/dfs/src/dfs_file.c
index 89e4bff5dd..646ae58e36 100644
--- a/components/dfs/src/dfs_file.c
+++ b/components/dfs/src/dfs_file.c
@@ -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;
}
diff --git a/components/dfs/src/dfs_fs.c b/components/dfs/src/dfs_fs.c
index fb970488dd..a183e7f124 100644
--- a/components/dfs/src/dfs_fs.c
+++ b/components/dfs/src/dfs_fs.c
@@ -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;
}
diff --git a/components/drivers/serial/serial.c b/components/drivers/serial/serial.c
index 9cf9abf701..959d8444c1 100644
--- a/components/drivers/serial/serial.c
+++ b/components/drivers/serial/serial.c
@@ -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))