A method to log and display text in a console screen simultaneously.
Is it necessary?

I don't see what this achieves that can't be done by piping the output of your program through tee or similar; it just removes flexibility (you can no longer not save the logs).

Naming

All identifiers containing double underscore are reserved for the implementation for any purpose - including as macros.  So you'll need to remove those from the relevant names.

Allow moving rvalues

In the constructor, it's better to accept the file name by value, and std::move() it into the member:

FileLogger(std::string pfileName, bool appendToFile = true)
    : fileName(std::move(pfileName)),
      linkWithFile(fileName!="&lt;null&gt;"),
      linkWithCout(true),
      appendToFile(appendToFile)
{}


Omit what can be defaulted

There's no need for a copy constructor that's identical to the compiler-provided one, so just omit that - and then you won't inhibit the generation of a move constructor.

Extensibility

How about a more composable, general-purpose tee_stream class?  Then you can output to as many locations as you like, chosen on the fly at runtime.

Don't surprise your users

Given FileLogger logCout ("log.text", false);, then  logCout &lt;&lt; "Hello " &lt;&lt; "World"; opens the file, writes Hello to it, closes it, then opens it again, truncating and replacing the contents with World.  Most users would expect both Hello and World to be present after that line.

You should document somewhere that users can't write to a file called &lt;null&gt; - or change the magic name to a better value, such as the empty string (then the test becomes !fileName.empty()).