CSyncFileLogWriter

This class implements the ILogWriter interface. It writes the formatted log messages to a file.

The writer formats the LOG message slightly differently than usual. There are two columns in the output. The LOG text is printed in the first column. It is wrapped when the column width is reached. In the second column, the other information is printed, such as time, the executing Java file, etc.. The second column is very far to the right in a normal editor, so you may have to scroll the output window to the right to see the contents. In return, it does not take up any space in the normal field of view, and more space remains for the important first column.

The log writer gets the settings (formatter, filename, level) from the preferences: see here.

Example for a printed message

Ups!                                                                                                                     2022-11-25 18:56:33.649769500 ERROR [main] de.sillysky.nyssr.impl.kernel.config.CKernelConfigurationTest.testLogging (277)
An example                                                                                                               2022-11-25 18:56:33.656770200 ERROR [main] de.sillysky.nyssr.impl.kernel.config.CKernelConfigurationTest.testLogging (278)
java.lang.Exception: Hm
    at de.sillysky.nyssr.impl.kernel.config.CKernelConfigurationTest.testLogging(CKernelConfigurationTest.java:278)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(NativeMethodAccessorImpl.java:-2)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:566)
    at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:59)
    at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
    at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:56)
    at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
    at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306)
    at org.junit.runners.BlockJUnit4ClassRunner$1.evaluate(BlockJUnit4ClassRunner.java:100)
    at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:366)
    at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:103)
    at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:63)
    at org.junit.runners.ParentRunner$4.run(ParentRunner.java:331)
    at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:79)
    at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:329)
    at org.junit.runners.ParentRunner.access$100(ParentRunner.java:66)
    at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:293)
    at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306)
    at org.junit.runners.ParentRunner.run(ParentRunner.java:413)
    at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
    at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:69)
    at com.intellij.rt.junit.IdeaTestRunner$Repeater$1.execute(IdeaTestRunner.java:38)
    at com.intellij.rt.execution.junit.TestsRepeater.repeat(TestsRepeater.java:11)
    at com.intellij.rt.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:35)
    at com.intellij.rt.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:235)
    at com.intellij.rt.junit.JUnitStarter.main(JUnitStarter.java:54)
Sorry!                                                                                                                   2022-11-25 18:56:33.657770800 ERROR [main] de.sillysky.nyssr.impl.kernel.config.CKernelConfigurationTest.testLogging (280)

nyssr.net - Innovative Distributed System