Aer*_*dir 4 php console symfony
我有一些命令可以将输出格式化到控制台。
这些命令是使用 Symfony 控制台组件编写的,并使用其样式进行格式化。
在控制台中运行时,格式很好,但这些命令通常也从我编写的队列系统中运行,因此日志会显示在 HTML 页面上。
结果真的很难理解,因为它充满了所有在控制台上有用但在网页上读取输出时完全没有用的格式“标签”。
这是我所说的一个例子:
[32mStarting command[39m
[32m===========================[39m
[34m[>] Analyzing Entity [39m[32This is the entity[39m[34m. [39m
[34m[>] Starting analyzing Entity [39m[32mThis is the entity[39m[34m. [39m
[34m[>] Creating new Job for [39m[30;42This is the entity[39;49m[34m to analyze it in [39m[30;42m+1 week[39;49m[34m (Cause: The Entity is a clone of [39m[30;42Entity2[39;49m[34m).[39m
[34m[>] New Job for [39m[30;42mEntity[39;49m[34m created. [39m
...
Run Code Online (Sandbox Code Playgroud)
如您所见,输出几乎不可读。
在将其保存到数据库之前,如何从中删除所有格式?
| 归档时间: |
|
| 查看次数: |
607 次 |
| 最近记录: |