【发布时间】:2016-04-30 08:52:59
【问题描述】:
将工作表与 Slick 一起使用时,它会记录很多调试信息,以至于我看不到我正在做的事情的实际结果。几个小时以来,我一直在尝试弄清楚如何禁用调试日志记录,但我无法弄清楚。
如何禁用(光滑)/(工作表)日志记录?
来自工作表:
db.run(
countries.take(5)
.map(_.country)
.result
)
输出约 200 行:
countries: slick.lifted.TableQuery[Country] = Rep(TableExpansion)
z: slick.lifted.Query[Country,Country#TableElementType,Seq] = Rep(Filter @968224334)
res0: java.sql.Connection = org.postgresql.jdbc4.Jdbc4Connection@40d24bbd
BEFORE
22:17:58.192 [NGSession 241: 127.0.0.1: compile-server] DEBUG slick.compiler.QueryCompiler - Source:
| Bind
| from s2: Take
| from: TableExpansion
| table s3: Table country
| columns: ProductNode
| 1: Path s3.id : String'
| 2: Path s3.name : String'
| count: LiteralNode 5 (volatileHint=false)
| select: Pure t4
| value: Path s2.name : String'
22:17:58.193 [NGSession 241: 127.0.0.1: compile-server] DEBUG slick.compiler.AssignUniqueSymbols - Detected features: UsedFeatures(false,false,false,false)
22:17:58.194 [NGSession 241: 127.0.0.1: compile-server] DEBUG slick.compiler.QueryCompiler - After phase assignUniqueSymbols:
| Bind
| from s5: Take
| from: TableExpansion
| table s6: Table country
| columns: ProductNode
| 1: Path s6.id : String'
| 2: Path s6.name : String'
| count: LiteralNode 5 (volatileHint=false)
| select: Pure t8
| value: Path s5.name : String'
22:17:58.195 [NGSession 241: 127.0.0.1: compile-server] DEBUG slick.compiler.QueryCompiler - After phase inferTypes: (no change)
22:17:58.196 [NGSession 241: 127.0.0.1: compile-server] DEBUG slick.compiler.ExpandTables - Found Selects for NominalTypes: @t7
22:17:58.197 [NGSession 241: 127.0.0.1: compile-server] DEBUG slick.compiler.ExpandTables - With correct table types:
| Bind : Vector[t8<String'>]
| from s5: Take : Vector[@t7<{id: String', name: String'}>]
| from: Table country : Vector[@t7<{id: String', name: String'}>]
| count: LiteralNode 5 (volatileHint=false) : Long
| select: Pure t8 : Vector[t8<String'>]
| value: Path s5.name : String'
22:17:58.197 [NGSession 241: 127.0.0.1: compile-server] DEBUG slick.compiler.ExpandTables - Table expansions: @t7 -> (s6,ProductNode)
22:17:58.198 [NGSession 241: 127.0.0.1: compile-server] DEBUG slick.compiler.QueryCompiler - After phase expandTables:
| Bind : Vector[t8<String'>]
| from s5: Take : Vector[@t7<{id: String', name: String'}>]
| from: Table country : Vector[@t7<{id: String', name: String'}>]
| count: LiteralNode 5 (volatileHint=false) : Long
| select: Pure t8 : Vector[t8<String'>]
| value: Path s5.name : String'
22:17:58.199 [NGSession 241: 127.0.0.1: compile-server] DEBUG slick.compiler.QueryCompiler - After phase forceOuterBinds:
| Bind : Vector[t8<String'>]
| from s5: Take : Vector[@t7<{id: String', name: String'}>]
| from: Table country : Vector[@t7<{id: String', name: String'}>]
| count: LiteralNode 5 (volatileHint=false) : Long
| select: Pure t8 : Vector[t8<String'>]
| value: Path s5.name : String'
22:17:58.200 [NGSession 241: 127.0.0.1: compile-server] DEBUG slick.compiler.QueryCompiler - After phase removeMappedTypes: (no change)
22:17:58.200 [NGSession 241: 127.0.0.1: compile-server] DEBUG slick.compiler.QueryCompiler - After phase expandSums: (no change)
22:17:58.201 [NGSession 241: 127.0.0.1: compile-server] DEBUG slick.compiler.QueryCompiler - After phase expandRecords:
| Bind : Vector[t8<String'>]
| from s5: Take : Vector[@t7<{id: String', name: String'}>]
| from: Table country : Vector[@t7<{id: String', name: String'}>]
| count: LiteralNode 5 (volatileHint=false) : Long
| select: Pure t8 : Vector[t8<String'>]
| value: Path s5.name : String'
22:17:58.202 [NGSession 241: 127.0.0.1: compile-server] DEBUG slick.compiler.FlattenProjections - Flattening projection t8
22:17:58.202 [NGSession 241: 127.0.0.1: compile-server] DEBUG slick.compiler.FlattenProjections - Analyzing s5.name with symbols
| Path s5.name : String'
22:17:58.203 [NGSession 241: 127.0.0.1: compile-server] DEBUG slick.compiler.FlattenProjections - Translated s5.name to:
| Path s5.name
22:17:58.203 [NGSession 241: 127.0.0.1: compile-server] DEBUG slick.compiler.FlattenProjections - Flattening node at Path
| Path s5.name
22:17:58.204 [NGSession 241: 127.0.0.1: compile-server] DEBUG slick.compiler.FlattenProjections - Adding definition: s9 -> Path s5.name
22:17:58.204 [NGSession 241: 127.0.0.1: compile-server] DEBUG slick.compiler.FlattenProjections - Adding translation for t8: (Map(List() -> s9), UnassignedType)
22:17:58.204 [NGSession 241: 127.0.0.1: compile-server] DEBUG slick.compiler.FlattenProjections - Flattened projection to
| Pure t8
| value: StructNode
| s9: Path s5.name
22:17:58.205 [NGSession 241: 127.0.0.1: compile-server] DEBUG slick.compiler.QueryCompiler - After phase flattenProjections:
| Bind : Vector[t8<{s9: String'}>]
| from s5: Take : Vector[@t7<{id: String', name: String'}>]
| from: Table country : Vector[@t7<{id: String', name: String'}>]
| count: LiteralNode 5 (volatileHint=false) : Long
| select: Pure t8 : Vector[t8<{s9: String'}>]
| value: StructNode : {s9: String'}
| s9: Path s5.name : String'
(它会一直持续下去......)
那么我该如何关闭这个日志记录呢?
【问题讨论】:
标签: scala intellij-idea slick